From 7a0699ae8f14020fa2cbf90292e7374e742703f7 Mon Sep 17 00:00:00 2001 From: fallenoak Date: Wed, 2 Dec 2020 22:56:09 -0600 Subject: [PATCH] chore(build): check for no-invalid-offsetof before applying --- storm/CMakeLists.txt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/storm/CMakeLists.txt b/storm/CMakeLists.txt index 35d05ed..1d362f3 100644 --- a/storm/CMakeLists.txt +++ b/storm/CMakeLists.txt @@ -1,3 +1,6 @@ +include(CheckCCompilerFlag) +check_c_compiler_flag(-Wno-invalid-offsetof HAS_NO_INVALID_OFFSETOF) + file(GLOB STORM_SOURCES "*.cpp" "hash/*.cpp" @@ -37,7 +40,9 @@ target_link_libraries(storm system ) -target_compile_options(storm - PUBLIC - -Wno-invalid-offsetof -) +if(HAS_NO_INVALID_OFFSETOF) + target_compile_options(storm + PUBLIC + -Wno-invalid-offsetof + ) +endif()