Skip to content
Browse files

print warning instead of silently resetting *_FLAGS:

- it doesn't work for cached vars (set(... CACHE ... FORCE) could work
- cleanup
  • Loading branch information...
1 parent 8c9befe commit 0d9374abae0145c10486fabda07b508b63f9a721 @abma abma committed Jul 7, 2014
Showing with 7 additions and 11 deletions.
  1. +7 −11 CMakeLists.txt
View
18 CMakeLists.txt
@@ -47,18 +47,14 @@ Else ("${CMAKE_BUILD_TYPE}" MATCHES "^DEBUG")
Set(DEBUG_BUILD FALSE)
EndIf ("${CMAKE_BUILD_TYPE}" MATCHES "^DEBUG")
-# MSVC needs the default flags
-if(NOT MSVC)
- ### Strip C[XX]_FLAGS
- option(CUSTOM_CFLAGS "If false all C[XX]_FLAGS are cleared (more reliable to sync/safer for online play)." FALSE)
- if (CUSTOM_CFLAGS)
- Message(WARNING "Using custom CXX_FLAGS! this build will very likely not sync in online mode!")
- else (CUSTOM_CFLAGS)
- set(CMAKE_C_FLAGS "")
- set(CMAKE_CXX_FLAGS "")
- endif (CUSTOM_CFLAGS)
-endif(NOT MSVC)
+if(NOT "${CMAKE_C_FLAGS}" STREQUAL "")
+ Message(WARNING "Using custom C_FLAGS: ${CMAKE_C_FLAGS} this build will very likely not sync in online mode!")
+endif()
+
+if(NOT "${CMAKE_CXX_FLAGS}" STREQUAL "")
+ Message(WARNING "Using custom CXX_FLAGS: ${CMAKE_CXX_FLAGS} this build will very likely not sync in online mode!")
+endif()
set (CUSTOM_COMPILER_DEFINITIONS "" CACHE STRING "Custom flags can be defined here")
if (CUSTOM_COMPILER_DEFINITIONS)

0 comments on commit 0d9374a

Please sign in to comment.
Something went wrong with that request. Please try again.