Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8368


Ignore:
Timestamp:
May 1, 2011, 3:09:28 AM (13 years ago)
Author:
rgrieder
Message:

Added CMake configuration type "RelForDevs", which replaces "RelWithDebInfo". That latter is now equivalent to "Release", but with symbols.
Also, I removed debug symbol generation for Release and MinSizeRel when compiling with MSVC.

The new configuration should be used as standard Release mode when developing. The other three release configurations are for actual installed binaries (and behave again as the name suggests).

Location:
code/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/CMakeLists.txt

    r8363 r8368  
    9292SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_SOURCE_DIR}/cmake/tools)
    9393
    94 # Set Debug build to default when not having multi-config generator like msvc
     94# Flag variables for extra configuration "RelForDevs" should be hidden
     95MARK_AS_ADVANCED(
     96  CMAKE_CXX_FLAGS_RELFORDEVS
     97  CMAKE_C_FLAGS_RELFORDEVS
     98  CMAKE_EXE_LINKER_FLAGS_RELFORDEVS
     99  CMAKE_MODULE_LINKER_FLAGS_RELFORDEVS
     100  CMAKE_SHARED_LINKER_FLAGS_RELFORDEVS
     101)
     102
    95103IF(NOT CMAKE_CONFIGURATION_TYPES)
     104  # Set Debug build to default when not having multi-config generator like MSVC or XCODE
    96105  IF(NOT CMAKE_BUILD_TYPE)
    97106    SET(CMAKE_BUILD_TYPE Debug CACHE STRING
    98         "Build types are: Debug, Release, MinSizeRel, RelWithDebInfo" FORCE)
     107        "Build types are: Debug, RelForDevs, RelWithDebInfo, Release, MinSizeRel" FORCE)
    99108  ENDIF()
    100109  MARK_AS_ADVANCED(CLEAR CMAKE_BUILD_TYPE)
     
    102111  MESSAGE(STATUS "*** Build type is ${CMAKE_BUILD_TYPE} ***")
    103112ELSE()
     113  # Make sure no build type is ever set
    104114  IF(CMAKE_BUILD_TYPE)
    105115    SET(CMAKE_BUILD_TYPE CACHE STRING FORCE)
    106116  ENDIF()
    107   MARK_AS_ADVANCED(CMAKE_BUILD_TYPE)
     117  MARK_AS_ADVANCED(FORCE CMAKE_BUILD_TYPE)
     118  # Add our extra configuration "RelForDevs"
     119  SET(CMAKE_CONFIGURATION_TYPES "Debug;RelForDevs;RelWithDebInfo;Release;MinSizeRel"
     120      CACHE STRING "Semicolon separated list of supported configuration types." FORCE)
    108121ENDIF()
    109122
  • code/trunk/cmake/CompilerConfigGCC.cmake

    r8364 r8368  
    5252SET_COMPILER_FLAGS("    -g -ggdb -D_DEBUG" Debug          CACHE)
    5353SET_COMPILER_FLAGS("             -DNDEBUG" ReleaseAll     CACHE)
     54ADD_COMPILER_FLAGS("-O2 -g -ggdb"          RelForDevs     CACHE)
     55ADD_COMPILER_FLAGS("-O3 -g -ggdb"          RelWithDebInfo CACHE)
    5456ADD_COMPILER_FLAGS("-O3"                   Release        CACHE)
    55 ADD_COMPILER_FLAGS("-O2 -g -ggdb"          RelWithDebInfo CACHE)
    5657ADD_COMPILER_FLAGS("-Os"                   MinSizeRel     CACHE)
    5758
     
    112113# Add compiler and linker flags for MinGW
    113114IF (MINGW)
    114   ADD_COMPILER_FLAGS("-gstabs+" Debug          CACHE)
    115   ADD_COMPILER_FLAGS("-gstabs+" RelWithDebInfo CACHE)
     115  ADD_COMPILER_FLAGS("-gstabs+" Debug RelForDevs RelWithDebInfo CACHE)
    116116
    117117  ADD_LINKER_FLAGS("-enable-auto-import" CACHE)
  • code/trunk/cmake/CompilerConfigMSVC.cmake

    r8362 r8368  
    4040# additionally for CXX: -EHsc -GR
    4141# We keep these flags but reset the build specific flags
    42 SET_COMPILER_FLAGS("" Debug RelWithDebInfo Release MinSizeRel CACHE)
     42SET_COMPILER_FLAGS("" Debug RelForDevs RelWithDebInfo Release MinSizeRel CACHE)
    4343
    4444# Make sure we define all the possible macros for identifying Windows
     
    5151ADD_COMPILER_FLAGS("-MP" CACHE)
    5252
    53 # Always generate debug symbols (there is really no reason not to)
    54 ADD_COMPILER_FLAGS("-Zi" CACHE)
    55 
    5653# Never omit frame pointers to avoid useless stack traces (the performance
    5754# loss is almost not measurable)
     
    6259# Set build specific flags.
    6360# -MD[d]    Multithreaded [debug] shared MSVC runtime library
     61# -Zi       Generate debug symbols
    6462# -O[d|2|1] No optimisations, optimise for speed, optimise for size
    6563# -Oi[-]    Use or disable use of intrinisic functions
    6664# -GL       Link time code generation (see -LTCG in linker flags)
    6765# -RTC1     Both basic runtime checks
    68 ADD_COMPILER_FLAGS("-MDd -Od -Oi  -D_DEBUG -RTC1" Debug          CACHE)
    69 ADD_COMPILER_FLAGS("-MD  -O2 -Oi  -DNDEBUG"       RelWithDebInfo CACHE)
    70 ADD_COMPILER_FLAGS("-MD  -O2 -Oi  -DNDEBUG -GL"   Release        CACHE)
    71 ADD_COMPILER_FLAGS("-MD  -O1 -Oi- -DNDEBUG -GL"   MinSizeRel     CACHE)
     66ADD_COMPILER_FLAGS("-MDd -Zi -Od -Oi  -D_DEBUG -RTC1" Debug          CACHE)
     67ADD_COMPILER_FLAGS("-MD  -Zi -O2 -Oi  -DNDEBUG"       RelForDevs     CACHE)
     68ADD_COMPILER_FLAGS("-MD  -Zi -O2 -Oi  -DNDEBUG -GL"   RelWithDebInfo CACHE)
     69ADD_COMPILER_FLAGS("-MD      -O2 -Oi  -DNDEBUG -GL"   Release        CACHE)
     70ADD_COMPILER_FLAGS("-MD      -O1 -Oi- -DNDEBUG -GL"   MinSizeRel     CACHE)
    7271
    7372
     
    120119# CMake default flags: -MANIFEST -STACK:10000000 -machine:I386
    121120# We keep these flags but reset the build specific flags
    122 SET_LINKER_FLAGS("" Debug RelWithDebInfo Release MinSizeRel CACHE)
    123 
    124 # Always generate debug symbols (there is really no reason not to)
    125 ADD_LINKER_FLAGS("-DEBUG" CACHE)
     121SET_LINKER_FLAGS("" Debug RelForDevs RelWithDebInfo Release MinSizeRel CACHE)
    126122
    127123# Never fold multiple functions into a single one because we might compare
     
    132128ADD_LINKER_FLAGS("-OPT:NOWIN98" MSVC80 CACHE)
    133129
     130# Generate debug symbols
     131ADD_LINKER_FLAGS("-DEBUG" Debug RelForDevs RelWithDebInfo CACHE)
     132
    134133# Incremental linking speeds up development builds
    135 ADD_LINKER_FLAGS("-INCREMENTAL:YES" Debug   RelWithDebInfo CACHE)
    136 ADD_LINKER_FLAGS("-INCREMENTAL:NO"  Release MinSizeRel    CACHE)
     134ADD_LINKER_FLAGS("-INCREMENTAL:YES" Debug   RelForDevs                CACHE)
     135ADD_LINKER_FLAGS("-INCREMENTAL:NO"  Release RelWithDebInfo MinSizeRel CACHE)
    137136
    138137# Eliminate unreferenced data
    139 ADD_LINKER_FLAGS("-OPT:REF" Release MinSizeRel CACHE)
     138ADD_LINKER_FLAGS("-OPT:REF" Release RelWithDebInfo MinSizeRel CACHE)
    140139
    141140# Link time code generation can improve run time performance at the cost of
    142141# hugely increased link time (the total build time is about the same though)
    143 ADD_LINKER_FLAGS("-LTCG" Release MinSizeRel CACHE)
     142ADD_LINKER_FLAGS("-LTCG" Release RelWithDebInfo MinSizeRel CACHE)
  • code/trunk/cmake/PackageConfig.cmake

    r8351 r8368  
    8181        FILES ${DEP_BINARY_DIR}/${_file}
    8282        DESTINATION bin
    83         CONFIGURATIONS Release RelWithDebInfo MinSizeRel
     83        CONFIGURATIONS RelForDevs Release RelWithDebInfo MinSizeRel
    8484      )
    8585    ENDFOREACH(_file)
     
    9090      DIRECTORY ${DEP_BINARY_DIR}/
    9191      DESTINATION bin
    92       CONFIGURATIONS Release RelWithDebInfo MinSizeRel
     92      CONFIGURATIONS RelForDevs Release RelWithDebInfo MinSizeRel
    9393      REGEX "_[Dd]\\.[a-zA-Z0-9+-]+$|-mt-gd-|^.*\\.pdb$" EXCLUDE
    9494    )
  • code/trunk/cmake/PackageConfigOSX.cmake

    r8351 r8368  
    9898    DIRECTORY ${DEP_BINARY_DIR}/
    9999    DESTINATION bin
    100     CONFIGURATIONS Release RelWithDebInfo MinSizeRel
     100    CONFIGURATIONS RelForDevs Release RelWithDebInfo MinSizeRel
    101101    REGEX "_[Dd]\\.[a-zA-Z0-9+-]+$|-mt-gd-|^.*\\.pdb$" EXCLUDE
    102102  )
  • code/trunk/cmake/tools/FlagUtilities.cmake

    r7163 r8368  
    2222 #  Description:
    2323 #    Sets the compiler/linker flags. After the flags you can specify more args:
    24  #    Release, Debug, RelWithDebInfo, MinSizeRel: Build configs (inclusive)
     24 #    Release, Debug, RelWithDebInfo, MinSizeRel, RelForDevs: Build configs
    2525 #    ReleaseAll: Sets the flags of all three release builds
    2626 #    CACHE: Values are witten with SET_CACHE_ADVANCED
     
    3636 #    REMOVE_COMPILER_FLAGS("/Gm "asdf" -q"test -foo" CXX ReleaseAll NOT UNIX)
    3737 #    This will only remove the CXX (C++) flags on a non Unix system for the
    38  #    Release, RelWithDebInfo and MinSizeRel configurations. The macros should
    39  #    be able to cope with "test -foo" as string argument for a flag.
     38 #    Release, RelWithDebInfo, MinSizeRel, RelForDevs configurations. The macros
     39 #    should be able to cope with "test -foo" as string argument for a flag.
    4040 #
    4141
     
    8989    IF(_arg MATCHES "${_key_regex}")
    9090      LIST(APPEND _langs "${_arg}")
    91     ELSEIF(   _arg MATCHES "^(Debug|Release|MinSizeRel|RelWithDebInfo)$"
    92            OR _arg MATCHES "^(DEBUG|RELEASE|MINSIZEREL|RELWITHDEBINFO)$")
     91    ELSEIF(   _arg MATCHES "^(Debug|Release|MinSizeRel|RelWithDebInfo|RelForDevs)$"
     92           OR _arg MATCHES "^(DEBUG|RELEASE|MINSIZEREL|RELWITHDEBINFO|RelForDevs)$")
    9393      STRING(TOUPPER "${_arg}" _upper_arg)
    9494      LIST(APPEND _build_types ${_upper_arg})
    9595    ELSEIF(_arg STREQUAL "ReleaseAll")
    96       LIST(APPEND _build_types RELEASE MINSIZEREL RELWITHDEBINFO)
     96      LIST(APPEND _build_types RELEASE MINSIZEREL RELWITHDEBINFO RELFORDEVS)
    9797    ELSEIF(_arg STREQUAL "CACHE")
    9898      SET(_write_to_cache TRUE)
  • code/trunk/src/OrxonoxConfig.cmake

    r8363 r8368  
    7575# about the active one we have to define the macro for each configuration
    7676ADD_COMPILER_FLAGS("-DCMAKE_Debug_BUILD"          Debug)
     77ADD_COMPILER_FLAGS("-DCMAKE_RelForDevs_BUILD"     RelForDevs)
    7778ADD_COMPILER_FLAGS("-DCMAKE_Release_BUILD"        Release)
    7879ADD_COMPILER_FLAGS("-DCMAKE_RelWithDebInfo_BUILD" RelWithDebInfo)
  • code/trunk/src/OrxonoxConfig.h.in

    r8363 r8368  
    179179*/
    180180
    181 // Configurations Release and MinSizeRel are designed for redistribution while
    182 // RelWithDebInfo is more for development
     181// Configurations Release, RelWithDebInfo and MinSizeRel are designed for
     182// redistribution while RelForDevs is for development purposes
    183183// ORXONOX_RELEASE simplifies this a little bit
    184 #if defined(CMAKE_Release_BUILD) || defined(CMAKE_MinSizeRel_BUILD)
     184#if defined(CMAKE_Release_BUILD) || defined(CMAKE_MinSizeRel_BUILD) \
     185    || defined(CMAKE_RelWithDebInfo_BUILD)
    185186#  define ORXONOX_RELEASE
    186187#endif
  • code/trunk/src/orxonox-main.vcproj.user.in

    r7420 r8368  
    88                <Configuration
    99                        Name="Debug|${MSVC_PLATFORM}"
     10                        >
     11                        <DebugSettings
     12                                WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)"
     13                                Environment="PATH=${RUNTIME_LIBRARY_DIRECTORY};%PATH%"
     14                                EnvironmentMerge="true"
     15                        />
     16                </Configuration>
     17                <Configuration
     18                        Name="RelForDevs|${MSVC_PLATFORM}"
    1019                        >
    1120                        <DebugSettings
  • code/trunk/src/orxonox-main.vcxproj.user.in

    r8351 r8368  
    22<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    33  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|${MSVC_PLATFORM}'">
     4    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
     5    <LocalDebuggerEnvironment>PATH=${RUNTIME_LIBRARY_DIRECTORY};%PATH%</LocalDebuggerEnvironment>
     6    <LocalDebuggerWorkingDirectory>$(Outdir)</LocalDebuggerWorkingDirectory>
     7  </PropertyGroup>
     8  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelForDevs|${MSVC_PLATFORM}'">
    49    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
    510    <LocalDebuggerEnvironment>PATH=${RUNTIME_LIBRARY_DIRECTORY};%PATH%</LocalDebuggerEnvironment>
Note: See TracChangeset for help on using the changeset viewer.