AK: Disable -Wunqualified-std-cast-call explicitly in CMake

When importing libraries with swiftc, the pragma to ignore this
warning isn't respected. So apply it on the command line.
This commit is contained in:
Andrew Kaster 2024-08-04 17:10:27 -06:00
parent fa5800ebc5
commit 15f25d56b8
Notes: github-actions[bot] 2024-08-07 00:29:23 +00:00
2 changed files with 4 additions and 8 deletions

View file

@ -6,15 +6,9 @@
#pragma once
#include <AK/Platform.h>
#if defined(AK_COMPILER_CLANG)
# pragma clang diagnostic ignored "-Wunqualified-std-cast-call"
#endif
#include <AK/StdLibExtraDetails.h>
#include <AK/Assertions.h>
#include <AK/Platform.h>
#include <AK/StdLibExtraDetails.h>
#include <utility>

View file

@ -81,6 +81,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_CXX_SIMULATE_ID MATCHES
add_cxx_compile_options(-Wno-implicit-const-int-float-conversion)
add_cxx_compile_options(-Wno-user-defined-literals)
add_cxx_compile_options(-Wno-vla-cxx-extension)
add_cxx_compile_options(-Wno-unqualified-std-cast-call)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# Only ignore expansion-to-defined for g++, clang's implementation doesn't complain about function-like macros
add_cxx_compile_options(-Wno-expansion-to-defined)
@ -91,6 +92,7 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang$" AND CMAKE_CXX_SIMULATE_ID MATCHES "MSVC")
add_cxx_compile_options(-Wno-reserved-identifier)
add_cxx_compile_options(-Wno-user-defined-literals)
add_cxx_compile_options(-Wno-unqualified-std-cast-call)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
# TODO: this seems wrong, but we use this kind of code too much