better flag-related messages, cleanup

This commit is contained in:
Menche 2015-04-17 22:04:47 -07:00
parent 2a654cfe3d
commit bdbc2c99fe
2 changed files with 15 additions and 13 deletions

View File

@ -32,8 +32,6 @@ endif()
set(CPU_OPTS 0 CACHE BOOL "Enable CPU optimizations")
set(WARN_ALL 1 CACHE BOOL "Enable -Wall for Release build")
if(NOT CMAKE_BUILD_TYPE)
# Default to release
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type: Debug or Release" FORCE)

View File

@ -378,14 +378,14 @@ else()
set(OPT_FLAGS "-O2 -fomit-frame-pointer")
endif()
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG ${SAFETY_FLAGS} ${OPT_FLAGS} -pipe")
set(CMAKE_CXX_FLAGS_RELEASE "${OPT_FLAGS} ${SAFETY_FLAGS} -Wall -DNDEBUG -pipe")
set(CMAKE_CXX_FLAGS_DEBUG "${SAFETY_FLAGS} -Wall -O0 -g2 -ggdb")
set(CMAKE_C_FLAGS_RELEASE "-DNDEBUG ${SAFETY_FLAGS} ${OPT_FLAGS} -pipe")
set(CMAKE_C_FLAGS_DEBUG "${SAFETY_FLAGS} -Wall -O0 -g2 -ggdb")
set(CMAKE_C_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
set(CMAKE_C_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-Wl,-O1,--as-needed,--discard-all,--no-undefined,--sort-common,-z,relro,-z,now")
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "-Wl,-O1,--as-needed,--discard-all,--no-undefined,--sort-common,-z,relro,-z,now")
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "-Wl,-O1,--as-needed,--discard-all,--no-undefined,--sort-common,-z,relro,-z,now")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-Wl,-O1,--as-needed,--discard-all,--no-undefined,-s,--sort-common,--hash-style=gnu,-z,relro,-z,now")
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE ${CMAKE_EXE_LINKER_FLAGS_RELEASE})
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE ${CMAKE_EXE_LINKER_FLAGS_RELEASE})
if(USE_GPROF)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -pg")
@ -396,12 +396,16 @@ else()
COMPILE_DEFINITIONS "SERVER")
endif(BUILD_SERVER)
if(CMAKE_BUILD_TYPE STREQUAL Release)
MESSAGE(STATUS "C/CXX Flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
MESSAGE(STATUS "Linker Flags: ${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
else()
if(CMAKE_BUILD_TYPE STREQUAL Debug)
MESSAGE(STATUS "C/CXX Flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}")
MESSAGE(STATUS "Linker Flags: ${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
endif()
endif()
endif()
MESSAGE(STATUS "Release Flags: ${CMAKE_CXX_FLAGS_RELEASE}")
MESSAGE(STATUS "Debug Flags: ${CMAKE_CXX_FLAGS_DEBUG}")
MESSAGE(STATUS "Linker Flags: ${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
#
# Installation
#