From de057472f3246eb6b1fe288b32aaf6f0d9fc994a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Mayer?= Date: Mon, 4 Nov 2013 20:29:29 +0000 Subject: [PATCH] - Reenable /LARGEADDRESSAWARE on Windows platform - Add a CMAKE_BUILD_TYPE default of RelWithDebInfo (Release with debug info), print the choice. This will pick up the previously used flags LINK_FLAGS and CMAKE_C_FLAGS and CMAKE_CXX_FLAGS but also pick up the variables postfixed by _ - Remove Optimization (-O2) and debug (-g) flags from list of default flags as they are now automagically set by CMAKE_C_FLAGS_RELWITHDEBINFO etc. NOTE: This also needs to be done for the Windows flags, I just don't have a Win system to test on right now. svn path=/trunk/; revision=53083 --- CMakeLists.txt | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 61013f0087..9173aa9378 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,15 @@ if(COMMAND cmake_policy) # cmake_policy(SET CMP0015 NEW) endif(COMMAND cmake_policy) +# This cannot be implemented via option(...) +if( NOT CMAKE_BUILD_TYPE ) + set( CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING + "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." + FORCE) +endif() +message(STATUS "Configuration types: ${CMAKE_CONFIGURATION_TYPES}") +message(STATUS "${CMAKE_BUILD_TYPE}: ${CMAKE_C_FLAGS_RELWITHDEBINFO}") + # set(PROJECT_MAJOR_VERSION 1) # set(PROJECT_MINOR_VERSION 9) # set(PROJECT_PATCH_VERSION 0) @@ -146,8 +155,7 @@ if( CMAKE_C_COMPILER_ID MATCHES "MSVC") ) else() set(WIRESHARK_C_FLAGS - -O2 - -g + # -O and -g get set by the CMAKE_BUILD_TYPE -Wall -W -Wextra @@ -288,10 +296,10 @@ endif() if( CMAKE_C_COMPILER_ID MATCHES "MSVC") - # Set in Makefile.nmake but doesn't seem to have any effect - # set(WIRESHARK_LD_FLAGS - # /LARGEADDRESSAWARE - # ) + # Set in Makefile.nmake + set(WIRESHARK_LD_FLAGS + /LARGEADDRESSAWARE + ) else() set(WIRESHARK_LD_FLAGS -Wl,--as-needed