1
0
mirror of synced 2024-11-28 01:20:51 +01:00

build: Only enable GCC-exclusive warnings on GCC (#1091)

Move all the flags added into an if block, since the flags are for
GCC/Clang and are not suitable for Visual Studio.
This commit is contained in:
KOLANICH 2023-06-13 21:01:26 +00:00 committed by GitHub
parent dd832bfa7e
commit 330c8399ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -412,8 +412,13 @@ function(downloadImHexPatternsFiles dest)
endfunction()
macro(setupCompilerWarnings target)
set(IMHEX_COMMON_FLAGS "-Wall -Wextra -Wpedantic -Werror")
set(IMHEX_C_FLAGS "${IMHEX_COMMON_FLAGS} -Wno-restrict -Wno-stringop-overread -Wno-stringop-overflow -Wno-array-bounds -Wno-dangling-reference")
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
set(IMHEX_COMMON_FLAGS "-Wall -Wextra -Wpedantic -Werror")
set(IMHEX_C_FLAGS "${IMHEX_COMMON_FLAGS} -Wno-array-bounds")
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(IMHEX_C_FLAGS "${IMHEX_C_FLAGS} -Wno-restrict -Wno-stringop-overread -Wno-stringop-overflow -Wno-dangling-reference")
endif()
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${IMHEX_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${IMHEX_C_FLAGS}")