Imported Upstream version 2.8.10.2
[platform/upstream/cmake.git] / Modules / CMakeCommonLanguageInclude.cmake
1
2 #=============================================================================
3 # Copyright 2004-2009 Kitware, Inc.
4 #
5 # Distributed under the OSI-approved BSD License (the "License");
6 # see accompanying file Copyright.txt for details.
7 #
8 # This software is distributed WITHOUT ANY WARRANTY; without even the
9 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 # See the License for more information.
11 #=============================================================================
12 # (To distribute this file outside of CMake, substitute the full
13 #  License text for the above reference.)
14
15 # this file has flags that are shared across languages and sets
16 # cache values that can be initialized in the platform-compiler.cmake file
17 # it may be included by more than one language.
18
19 set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
20      CACHE STRING "Flags used by the linker.")
21
22
23 if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
24 # default build type is none
25   if(NOT CMAKE_NO_BUILD_TYPE)
26     set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
27       "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
28   endif()
29
30   set (CMAKE_EXE_LINKER_FLAGS_DEBUG ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
31      "Flags used by the linker during debug builds.")
32
33   set (CMAKE_EXE_LINKER_FLAGS_MINSIZEREL ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT} CACHE STRING
34      "Flags used by the linker during release minsize builds.")
35
36   set (CMAKE_EXE_LINKER_FLAGS_RELEASE ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
37      "Flags used by the linker during release builds.")
38
39   set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
40      ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
41      "Flags used by the linker during Release with Debug Info builds.")
42
43   set (CMAKE_SHARED_LINKER_FLAGS_DEBUG ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
44      "Flags used by the linker during debug builds.")
45
46   set (CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL ${CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL_INIT}
47      CACHE STRING
48      "Flags used by the linker during release minsize builds.")
49
50   set (CMAKE_SHARED_LINKER_FLAGS_RELEASE ${CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
51      "Flags used by the linker during release builds.")
52
53   set (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
54      ${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
55      "Flags used by the linker during Release with Debug Info builds.")
56
57   set (CMAKE_MODULE_LINKER_FLAGS_DEBUG ${CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
58      "Flags used by the linker during debug builds.")
59
60   set (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL ${CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT}
61      CACHE STRING
62      "Flags used by the linker during release minsize builds.")
63
64   set (CMAKE_MODULE_LINKER_FLAGS_RELEASE ${CMAKE_MODULE_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
65      "Flags used by the linker during release builds.")
66
67   set (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
68      ${CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
69      "Flags used by the linker during Release with Debug Info builds.")
70
71 endif()
72 # shared linker flags
73 set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
74      CACHE STRING "Flags used by the linker during the creation of dll's.")
75
76 # module linker flags
77 set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
78      CACHE STRING "Flags used by the linker during the creation of modules.")
79
80 set(CMAKE_BUILD_TOOL ${CMAKE_MAKE_PROGRAM} CACHE INTERNAL
81      "What is the target build tool cmake is generating for.")
82
83
84 mark_as_advanced(
85 CMAKE_BUILD_TOOL
86 CMAKE_VERBOSE_MAKEFILE
87
88 CMAKE_EXE_LINKER_FLAGS
89 CMAKE_EXE_LINKER_FLAGS_DEBUG
90 CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
91 CMAKE_EXE_LINKER_FLAGS_RELEASE
92 CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
93
94 CMAKE_SHARED_LINKER_FLAGS
95 CMAKE_SHARED_LINKER_FLAGS_DEBUG
96 CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
97 CMAKE_SHARED_LINKER_FLAGS_RELEASE
98 CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
99
100 CMAKE_MODULE_LINKER_FLAGS
101 CMAKE_MODULE_LINKER_FLAGS_DEBUG
102 CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
103 CMAKE_MODULE_LINKER_FLAGS_RELEASE
104 CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
105
106 )
107