diff options
author | Alexander Neundorf <neundorf@kde.org> | 2007-07-11 20:22:04 (GMT) |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2007-07-11 20:22:04 (GMT) |
commit | bea1a5de771832463299146b4f2e4317c37f30bc (patch) | |
tree | b22c7527b5e9d4b21971f6b3d6d8aeda84e0015a /Modules/CMakeForceCompiler.cmake | |
parent | 9f16292b6a3a5959b2e7ddb11e54029b02701965 (diff) | |
download | CMake-bea1a5de771832463299146b4f2e4317c37f30bc.zip CMake-bea1a5de771832463299146b4f2e4317c37f30bc.tar.gz CMake-bea1a5de771832463299146b4f2e4317c37f30bc.tar.bz2 |
ENH: CMAKE_<LANG>_LINKER_PREFERENCE is now an integer priority, not a
two-step priority (None or Prefered)
Current order: ASM 0, C 10, Fortran 20, CXX 30, Java 40
This is the same order as automake choses:
http://www.gnu.org/software/automake/manual/html_node/How-the-Linker-is-Chosen.html
This change should be backward compatible:
if there is a project using fortran and CXX, they had to set the
LINKER_LANGUAGE explicitely, otherwise cmake complained (but still generated
the project files). Explicitely setting the linker language still overrides
automatic detection.
If somebody has a custom language for cmake and the PREFERENCE starts with
"P", its changed to 100, which gives it preference over all other languages
(except the other custom languages which have also "Prefered"). "None" is
converted to 0.
Alex
Diffstat (limited to 'Modules/CMakeForceCompiler.cmake')
-rw-r--r-- | Modules/CMakeForceCompiler.cmake | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Modules/CMakeForceCompiler.cmake b/Modules/CMakeForceCompiler.cmake index d104ad9..751fd78 100644 --- a/Modules/CMakeForceCompiler.cmake +++ b/Modules/CMakeForceCompiler.cmake @@ -38,6 +38,12 @@ MACRO(CMAKE_FORCE_C_COMPILER compiler id sizeof_void) SET(CMAKE_C_COMPILER_ID_RUN TRUE) SET(CMAKE_C_COMPILER_ID ${id}) SET(CMAKE_C_COMPILER_WORKS TRUE) + + # Set old compiler and platform id variables. + IF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU") + SET(CMAKE_COMPILER_IS_GNUCC 1) + ENDIF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU") + SET(CMAKE_SIZEOF_VOID_P ${sizeof_void} CACHE STRING "sizeof void") SET(HAVE_CMAKE_SIZEOF_VOID_P TRUE CACHE INTERNAL "have sizeof void") ENDMACRO(CMAKE_FORCE_C_COMPILER) @@ -47,5 +53,10 @@ MACRO(CMAKE_FORCE_CXX_COMPILER compiler id) SET(CMAKE_CXX_COMPILER_ID_RUN TRUE) SET(CMAKE_CXX_COMPILER_ID ${id}) SET(CMAKE_CXX_COMPILER_WORKS TRUE) + + IF("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") + SET(CMAKE_COMPILER_IS_GNUCXX 1) + ENDIF("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") + ENDMACRO(CMAKE_FORCE_CXX_COMPILER) |