commit 1fff59e2597adabc717a401f14438b369cfccdb2
parent c1ecca7b205371e10c5358e467564354f6422497
Author: fundamental <mark.d.mccurry@gmail.com>
Date: Tue, 16 Aug 2011 10:55:08 -0400
Cmake: ensureing build flags ordering
- This should resolve a build bug introduced in 581d320d4e044b0423728002393d8df411d33de1
Diffstat:
1 file changed, 17 insertions(+), 22 deletions(-)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
@@ -64,10 +64,6 @@ option (BuildForCore2_X86_64 "Build for Intel Core2 x86_64 system" OFF)
option (BuildForDebug "Include gdb debugging support" OFF)
set(CMAKE_BUILD_TYPE "Release")
-set(CMAKE_CXX_FLAGS_RELEASE "-O3 -msse -msse2 -mfpmath=sse -ffast-math -fno-finite-math-only -fomit-frame-pointer"
- CACHE STRING "basic x86 compiler options")
-set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3 -ggdbc -Wall -Wextra"
- CACHE STRING "Debug build flags")
set (BuildOptions_x86_64AMD
"-O3 -march=athlon64 -m64 -Wall -ffast-math -fno-finite-math-only -fomit-frame-pointer"
@@ -139,6 +135,23 @@ else()
message(STATUS "Error: building on unsupported OS")
endif()
+if (BuildForDebug)
+ set (CMAKE_BUILD_TYPE "Debug")
+ set (CMAKE_CXX_FLAGS_DEBUG ${BuildOptionsDebug})
+ message (STATUS "Building for ${CMAKE_BUILD_TYPE}, flags: ${CMAKE_CXX_FLAGS_DEBUG}")
+else (BuildForDebug)
+ set (CMAKE_BUILD_TYPE "Release")
+ if (BuildForAMD_X86_64)
+ set (CMAKE_CXX_FLAGS_RELEASE ${BuildOptions_x86_64AMD})
+ else (BuildForAMD_X86_64)
+ if (BuildForCore2_X86_64)
+ set (CMAKE_CXX_FLAGS_RELEASE ${BuildOptions_X86_64Core2})
+ else (BuildForCore2_X86_64)
+ set (CMAKE_CXX_FLAGS_RELEASE ${BuildOptionsBasic})
+ endif (BuildForCore2_X86_64)
+ endif (BuildForAMD_X86_64)
+ message (STATUS "Building for ${CMAKE_BUILD_TYPE}, flags: ${CMAKE_CXX_FLAGS_RELEASE}")
+endif (BuildForDebug)
if(FLTK_FOUND)
mark_as_advanced(FORCE FLTK_BASE_LIBRARY)
@@ -178,24 +191,6 @@ if(FltkGui)
add_subdirectory(UI)
endif()
-if (BuildForDebug)
- set (CMAKE_BUILD_TYPE "Debug")
- set (CMAKE_CXX_FLAGS_DEBUG ${BuildOptionsDebug})
- message (STATUS "Building for ${CMAKE_BUILD_TYPE}, flags: ${CMAKE_CXX_FLAGS_DEBUG}")
-else (BuildForDebug)
- set (CMAKE_BUILD_TYPE "Release")
- if (BuildForAMD_X86_64)
- set (CMAKE_CXX_FLAGS_RELEASE ${BuildOptions_x86_64AMD})
- else (BuildForAMD_X86_64)
- if (BuildForCore2_X86_64)
- set (CMAKE_CXX_FLAGS_RELEASE ${BuildOptions_X86_64Core2})
- else (BuildForCore2_X86_64)
- set (CMAKE_CXX_FLAGS_RELEASE ${BuildOptionsBasic})
- endif (BuildForCore2_X86_64)
- endif (BuildForAMD_X86_64)
- message (STATUS "Building for ${CMAKE_BUILD_TYPE}, flags: ${CMAKE_CXX_FLAGS_RELEASE}")
-endif (BuildForDebug)
-
########### General section ##############
# Following this should be only general compilation code, and no mention
# of module-specific variables