From 68ee3c67a8d23f68d9f87aea08548aba598ef14a Mon Sep 17 00:00:00 2001 From: HampusM Date: Wed, 2 Mar 2022 19:53:41 +0100 Subject: build: fix compiler cross compatibility --- src/CMakeLists.txt | 16 ++++++++++++---- 1 file 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) -- cgit v1.2.3-18-g5258