From b1ec40f531abfe5c206b9c1f5a49318c8803c808 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sat, 22 Oct 2016 22:24:19 +0200 Subject: [PATCH] Use -Wno-error=date-time only when compiler supports it --- CMakeLists.txt | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0553dfc566..cd2c9ba24a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -129,13 +129,12 @@ if (NOT DISABLE_RCT2) message("DISABLE_RCT2 implies FORCE32") endif() -if (LAUNCHPAD_BUILD) - # Launchpad turns on -Wdate-time for compilers that support it, this shouldn't break our build - set(COMMON_COMPILE_OPTIONS "${COMMON_COMPILE_OPTIONS} -Wno-error=date-time") -else() - if (FORCE32) - set(TARGET_M "-m32") - endif() +# Launchpad turns on -Wdate-time for compilers that support it, this shouldn't break our build +ADD_CHECK_C_COMPILER_FLAG(CMAKE_C_FLAGS C_WARN_WRITE_STRINGS -Wno-error=date-time) +ADD_CHECK_CXX_COMPILER_FLAG(CMAKE_CXX_FLAGS CXX_WARN_WRITE_STRINGS -Wno-error=date-time) + +if (FORCE32) + set(TARGET_M "-m32") endif() if (FORCE32)