cleanup and fixed problem when USE_MAIN option set to OFF
authorRafa Gaitán <rgaitan@crysis.(none)>
Mon, 7 Dec 2009 19:04:28 +0000 (20:04 +0100)
committerRafa Gaitán <rgaitan@crysis.(none)>
Mon, 7 Dec 2009 19:04:28 +0000 (20:04 +0100)
CMakeLists.txt

index d22cafa149bb7f5e317010c1d208b66070e3b5bf..071be0b6319b991602da94111f91cb19468d0694 100644 (file)
@@ -19,23 +19,25 @@ SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")
 INCLUDE(Macros)\r
 \r
 OPTION(USE_MAIN "Enable to activate aggressive warnings" OFF)\r
+\r
 IF(USE_MAIN)\r
-    ADD_DEFINITIONS(-DCRSFX_LIBRARY)\r
+    ADD_DEFINITIONS(-DUSE_MAIN)\r
 ENDIF(USE_MAIN)\r
 \r
 ADD_DEFINITIONS(-DX86_ASM)\r
 \r
+SET(4K_C_FLAGS "-m32 -Os -std=c99  -ffast-math -Wall -fno-strict-aliasing")\r
+\r
+SET(CMAKE_C_FLAGS ${4K_C_FLAGS} \r
+       CACHE STRING "Flags used by the compiler during all build types." FORCE)\r
+\r
 IF(APPLE)\r
-        SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32 -Os -std=c99 -fomit-frame-pointer -ffast-math -Wall -fno-strict-aliasing"\r
-            CACHE STRING "Flags used by the compiler during all build types." FORCE)\r
         SET(CMAKE_EXE_LINKER_FLAGS "-m32" CACHE STRING "Flags used by the linker during all build types." FORCE)\r
 ELSE(APPLE)\r
-        SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32 -Os -std=c99 -fomit-frame-pointer -ffast-math -Wall -fno-strict-aliasing"\r
-               CACHE STRING "Flags used by the compiler during all build types." FORCE)\r
         SET(CMAKE_EXE_LINKER_FLAGS "-m32 -nostdlib" CACHE STRING "Flags used by the linker during all build types." FORCE)\r
-        IF(USE_MAIN)\r
-            SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -nostartfiles")\r
-        ENDIF(USE_MAIN)\r
+        IF(NOT USE_MAIN)\r
+            SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -nostartfiles" CACHE STRING "Flags used by the linker during all build types." FORCE)\r
+        ENDIF(NOT USE_MAIN)\r
 ENDIF(APPLE)\r
 \r
 CONFIGURE_DEFAULTS()\r