Skip to content

Commit

Permalink
build: Don't use CMAKE_XXX_FLAGS
Browse files Browse the repository at this point in the history
  • Loading branch information
WerWolv committed Feb 1, 2025
1 parent 3095ad4 commit 4f46b5d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,16 @@ endif ()
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-stringop-overflow -Wno-dangling-reference -fexceptions -frtti")
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-stringop-overflow>)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fexceptions>)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-frtti>)
elseif (MSVC)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations -fexceptions -frtti")
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-deprecated-declarations>)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fexceptions>)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-frtti>)
elseif (NOT (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC"))
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-array-bounds")
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-array-bounds>)
endif()

if (CMAKE_CXX_COMPILER MATCHES "\\/em\\+\\+(-[a-zA-Z0-9.])?$")
Expand Down

0 comments on commit 4f46b5d

Please sign in to comment.