Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/buildsystem2/cmake/BuildConfigGCC.cmake @ 2621

Last change on this file since 2621 was 2621, checked in by rgrieder, 15 years ago

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
  • Property svn:eol-style set to native
File size: 2.0 KB
Line 
1 #
2 #   ORXONOX - the hottest 3D action shooter ever to exist
3 #                    > www.orxonox.net <
4 #
5 #
6 #   License notice:
7 #
8 #   This program is free software; you can redistribute it and/or
9 #   modify it under the terms of the GNU General Public License
10 #   as published by the Free Software Foundation; either version 2
11 #   of the License, or (at your option) any later version.
12 #
13 #   This program is distributed in the hope that it will be useful,
14 #   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 #   GNU General Public License for more details.
17 #
18 #   You should have received a copy of the GNU General Public License
19 #   along with this program; if not, write to the Free Software
20 #   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 #
22 #   Author:
23 #      Reto Grieder
24 #   Co-authors:
25 #      ...
26 #
27
28# Also include environment flags. Could cause conflicts though
29SET_COMPILER_FLAGS("$ENV{CXXFLAGS}" CXX CACHE)
30SET_COMPILER_FLAGS("$ENV{CFLAGS}"   C   CACHE)
31
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)
38
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 TracBrowser for help on using the repository browser.