From ed1b04f7e3feaa90e6e4cc6f4fe657f0220ba564 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafa=20Gait=C3=A1n?= Date: Mon, 7 Dec 2009 20:04:28 +0100 Subject: [PATCH] cleanup and fixed problem when USE_MAIN option set to OFF --- CMakeLists.txt | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d22cafa..071be0b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,23 +19,25 @@ SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}") INCLUDE(Macros) OPTION(USE_MAIN "Enable to activate aggressive warnings" OFF) + IF(USE_MAIN) - ADD_DEFINITIONS(-DCRSFX_LIBRARY) + ADD_DEFINITIONS(-DUSE_MAIN) ENDIF(USE_MAIN) ADD_DEFINITIONS(-DX86_ASM) +SET(4K_C_FLAGS "-m32 -Os -std=c99 -ffast-math -Wall -fno-strict-aliasing") + +SET(CMAKE_C_FLAGS ${4K_C_FLAGS} + CACHE STRING "Flags used by the compiler during all build types." FORCE) + IF(APPLE) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32 -Os -std=c99 -fomit-frame-pointer -ffast-math -Wall -fno-strict-aliasing" - CACHE STRING "Flags used by the compiler during all build types." FORCE) SET(CMAKE_EXE_LINKER_FLAGS "-m32" CACHE STRING "Flags used by the linker during all build types." FORCE) ELSE(APPLE) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32 -Os -std=c99 -fomit-frame-pointer -ffast-math -Wall -fno-strict-aliasing" - CACHE STRING "Flags used by the compiler during all build types." FORCE) SET(CMAKE_EXE_LINKER_FLAGS "-m32 -nostdlib" CACHE STRING "Flags used by the linker during all build types." FORCE) - IF(USE_MAIN) - SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -nostartfiles") - ENDIF(USE_MAIN) + IF(NOT USE_MAIN) + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -nostartfiles" CACHE STRING "Flags used by the linker during all build types." FORCE) + ENDIF(NOT USE_MAIN) ENDIF(APPLE) CONFIGURE_DEFAULTS() -- 2.34.1