diff options
author | HampusM <hampus@hampusmat.com> | 2022-03-02 19:53:41 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-06-13 17:56:54 +0200 |
commit | 68ee3c67a8d23f68d9f87aea08548aba598ef14a (patch) | |
tree | 780615309072f1284ef5f09eae196395172a5c03 /src/CMakeLists.txt | |
parent | ede689d23e57c9b701ab19aa9112a0b2368865c9 (diff) |
build: fix compiler cross compatibility
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r-- | src/CMakeLists.txt | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 54793b0..3ce32a1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -34,14 +34,22 @@ target_compile_options( -Wold-style-cast -Wcast-align -Wno-unused -Wconversion -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self - -Wlogical-op -Wmissing-declarations - -Wmissing-include-dirs -Wnoexcept -Woverloaded-virtual - -Wredundant-decls -Wsign-conversion -Wsign-promo - -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default + -Wmissing-declarations -Wmissing-include-dirs + -Woverloaded-virtual -Wredundant-decls + -Wsign-conversion -Wsign-promo + -Wstrict-overflow=5 -Wswitch-default -Wundef -Werror -pedantic -fsanitize=address -fno-exceptions ) +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + target_compile_options( + ${PROJECT_NAME} + PRIVATE + -Wlogical-op -Wnoexcept -Wstrict-null-sentinel + ) +endif() + target_include_directories(${PROJECT_NAME} PRIVATE .) target_link_libraries_system(${PROJECT_NAME} ctre fmt) |