Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 29, 2009, 11:35:54 PM (15 years ago)
Author:
rgrieder
Message:

This commit gets a little ugly, couldn't separate that anymore:

  • Renamed UseTolua.cmake to GenerateLuaBindings.cmake
  • Applied the macros for compiler flags, linker flags, header files and source groups Updated the whole build tree for that
  • Created real compiler config scripts (BuildConfigGCC.cmake and BuildConfigMSVC.cmake)
  • Large scale clean up in BuildConfig.cmake
  • You can now specify your own LibraryConfig and BuildConfig script via CMake Cache
  • Lots of small changes and fixes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/buildsystem2/cmake/BuildConfigGCC.cmake

    r2612 r2621  
    2626 #
    2727
    28 ###### Default Compiler/Linker Options ##########
    29 # Most people use GCC to compile orxonox, so use that as default
     28# Also include environment flags. Could cause conflicts though
     29SET_COMPILER_FLAGS("$ENV{CXXFLAGS}" CXX CACHE)
     30SET_COMPILER_FLAGS("$ENV{CFLAGS}"   C   CACHE)
    3031
    31 SET(CMAKE_C_FLAGS   "$ENV{CFLAGS}   ${ORXONOX_WARNING_FLAGS} -fPIC")
    32 SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} ${ORXONOX_WARNING_FLAGS} -fPIC")
    33 # These flags are added to the flags above
    34 SET(CMAKE_C_FLAGS_DEBUG            "    -g -ggdb")
    35 SET(CMAKE_CXX_FLAGS_DEBUG          "    -g -ggdb")
    36 SET(CMAKE_C_FLAGS_RELEASE          "-O3          -DNDEBUG")
    37 SET(CMAKE_CXX_FLAGS_RELEASE        "-O3          -DNDEBUG")
    38 SET(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g -ggdb -DNDEBUG")
    39 SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -ggdb -DNDEBUG")
    40 SET(CMAKE_C_FLAGS_MINSIZEREL       "-Os          -DNDEBUG")
    41 SET(CMAKE_CXX_FLAGS_MINSIZEREL     "-Os          -DNDEBUG")
     32# These flags get added to the flags above
     33SET_COMPILER_FLAGS("    -g -ggdb -D_DEBUG" Debug          CACHE)
     34SET_COMPILER_FLAGS("             -DNDEBUG" ReleaseAll     CACHE)
     35ADD_COMPILER_FLAGS("-O3"                   Release        CACHE)
     36ADD_COMPILER_FLAGS("-O2 -g -ggdb"          RelWithDebInfo CACHE)
     37ADD_COMPILER_FLAGS("-Os"                   MinSizeRel     CACHE)
    4238
    43 SET(CMAKE_LD_FLAGS "$ENV{LDFLAGS}")
    44 SET(CMAKE_EXE_LINKER_FLAGS    " --no-undefined")
    45 SET(CMAKE_SHARED_LINKER_FLAGS " --no-undefined")
    46 SET(CMAKE_MODULE_LINKER_FLAGS " --no-undefined")
     39# CMake doesn't seem to set the PIC flags right on certain 64 bit systems
     40IF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
     41  ADD_COMPILER_FLAGS("-fPIC" CACHE)
     42ENDIF(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
     43
     44# Increase warning level if requested
     45IF(EXTRA_WARNINGS)
     46  REMOVE_COMPILER_FLAGS("-Wall" CACHE)
     47  ADD_COMPILER_FLAGS("-Wextra --Wno-unused-parameter" CACHE)
     48ELSE(EXTRA_WARNINGS)
     49  REMOVE_COMPILER_FLAGS("-Wextra --Wno-unused-parameter" CACHE)
     50  ADD_COMPILER_FLAGS("-Wall" CACHE)
     51ENDIF(EXTRA_WARNINGS)
     52
     53# General linker flags
     54SET_LINKER_FLAGS("--no-undefined" CACHE)
Note: See TracChangeset for help on using the changeset viewer.