diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c5b396..32b3500 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -357,9 +357,6 @@ IF(CMAKE_COMPILER_IS_GNUCC) ADD_DEFINITIONS(-fno-stack-protector) ENDIF(AQUARIA_GCC_HAS_STACKPROT) - # We knowingly apply offsetof to non-POD types. - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof") - # -O3 breaks on some GCC/MinGW versions, make sure CMake does not set this as default. # Exceptions are not used, excluding support for release builds adds less bulk as well. set(CMAKE_C_FLAGS_RELEASE "-O2" CACHE STRING "Flags used for release builds" FORCE) @@ -451,6 +448,14 @@ SET(AQUARIA_SRCS_UNUSED ${SRCDIR}/WaterFont.cpp ) +IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) +SET_SOURCE_FILES_PROPERTIES( + # We knowingly apply offsetof to non-POD types. + ${SRCDIR}/ScriptInterface.cpp + PROPERTIES COMPILE_FLAGS "-Wno-invalid-offsetof" +) +ENDIF() + IF(MACOSX) IF(NOT AQUARIA_USE_SDL2) SET(COCOA_SRCS "${BBGEDIR}/Cocoa.mm")