Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
CMake
CMake
Commits
5eaac0c9
Commit
5eaac0c9
authored
Dec 02, 2015
by
Chuck Atkins
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compiler: Add infrastructure for detecting compiler wrappers
parent
4e29a514
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
70 additions
and
0 deletions
+70
-0
Modules/CMakeCCompiler.cmake.in
Modules/CMakeCCompiler.cmake.in
+1
-0
Modules/CMakeCInformation.cmake
Modules/CMakeCInformation.cmake
+8
-0
Modules/CMakeCXXCompiler.cmake.in
Modules/CMakeCXXCompiler.cmake.in
+1
-0
Modules/CMakeCXXInformation.cmake
Modules/CMakeCXXInformation.cmake
+8
-0
Modules/CMakeDetermineCompilerId.cmake
Modules/CMakeDetermineCompilerId.cmake
+6
-0
Modules/CMakeFortranCompiler.cmake.in
Modules/CMakeFortranCompiler.cmake.in
+1
-0
Modules/CMakeFortranInformation.cmake
Modules/CMakeFortranInformation.cmake
+8
-0
Modules/CMakeLanguageInformation.cmake
Modules/CMakeLanguageInformation.cmake
+37
-0
No files found.
Modules/CMakeCCompiler.cmake.in
View file @
5eaac0c9
...
...
@@ -2,6 +2,7 @@ set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@")
set(CMAKE_C_COMPILER_ARG1 "@CMAKE_C_COMPILER_ARG1@")
set(CMAKE_C_COMPILER_ID "@CMAKE_C_COMPILER_ID@")
set(CMAKE_C_COMPILER_VERSION "@CMAKE_C_COMPILER_VERSION@")
set(CMAKE_C_COMPILER_WRAPPER "@CMAKE_C_COMPILER_WRAPPER@")
set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "@CMAKE_C_STANDARD_COMPUTED_DEFAULT@")
set(CMAKE_C_COMPILE_FEATURES "@CMAKE_C_COMPILE_FEATURES@")
set(CMAKE_C90_COMPILE_FEATURES "@CMAKE_C90_COMPILE_FEATURES@")
...
...
Modules/CMakeCInformation.cmake
View file @
5eaac0c9
...
...
@@ -18,6 +18,8 @@
# It also loads a system - compiler - processor (or target hardware)
# specific file, which is mainly useful for crosscompiling and embedded systems.
include
(
CMakeLanguageInformation
)
# some compilers use different extensions (e.g. sdcc uses .rel)
# so set the extension here first so it can be overridden by the compiler specific file
if
(
UNIX
)
...
...
@@ -60,6 +62,12 @@ if (NOT _INCLUDED_FILE)
include
(
Platform/
${
CMAKE_SYSTEM_NAME
}
-
${
CMAKE_BASE_NAME
}
OPTIONAL RESULT_VARIABLE _INCLUDED_FILE
)
endif
()
# load any compiler-wrapper specific information
if
(
CMAKE_C_COMPILER_WRAPPER
)
__cmake_include_compiler_wrapper
(
C
)
endif
()
# We specify the compiler information in the system file for some
# platforms, but this language may not have been enabled when the file
# was first included. Include it again to get the language info.
...
...
Modules/CMakeCXXCompiler.cmake.in
View file @
5eaac0c9
...
...
@@ -2,6 +2,7 @@ set(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@")
set(CMAKE_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@")
set(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@")
set(CMAKE_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@")
set(CMAKE_CXX_COMPILER_WRAPPER "@CMAKE_CXX_COMPILER_WRAPPER@")
set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "@CMAKE_CXX_STANDARD_COMPUTED_DEFAULT@")
set(CMAKE_CXX_COMPILE_FEATURES "@CMAKE_CXX_COMPILE_FEATURES@")
set(CMAKE_CXX98_COMPILE_FEATURES "@CMAKE_CXX98_COMPILE_FEATURES@")
...
...
Modules/CMakeCXXInformation.cmake
View file @
5eaac0c9
...
...
@@ -18,6 +18,8 @@
# It also loads a system - compiler - processor (or target hardware)
# specific file, which is mainly useful for crosscompiling and embedded systems.
include
(
CMakeLanguageInformation
)
# some compilers use different extensions (e.g. sdcc uses .rel)
# so set the extension here first so it can be overridden by the compiler specific file
if
(
UNIX
)
...
...
@@ -59,6 +61,12 @@ if (NOT _INCLUDED_FILE)
include
(
Platform/
${
CMAKE_SYSTEM_NAME
}
-
${
CMAKE_BASE_NAME
}
OPTIONAL
RESULT_VARIABLE _INCLUDED_FILE
)
endif
()
# load any compiler-wrapper specific information
if
(
CMAKE_CXX_COMPILER_WRAPPER
)
__cmake_include_compiler_wrapper
(
CXX
)
endif
()
# We specify the compiler information in the system file for some
# platforms, but this language may not have been enabled when the file
# was first included. Include it again to get the language info.
...
...
Modules/CMakeDetermineCompilerId.cmake
View file @
5eaac0c9
...
...
@@ -107,6 +107,7 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
PARENT_SCOPE
)
set
(
CMAKE_
${
lang
}
_CL_SHOWINCLUDES_PREFIX
"
${
CMAKE_
${
lang
}
_CL_SHOWINCLUDES_PREFIX
}
"
PARENT_SCOPE
)
set
(
CMAKE_
${
lang
}
_COMPILER_VERSION
"
${
CMAKE_
${
lang
}
_COMPILER_VERSION
}
"
PARENT_SCOPE
)
set
(
CMAKE_
${
lang
}
_COMPILER_WRAPPER
"
${
CMAKE_
${
lang
}
_COMPILER_WRAPPER
}
"
PARENT_SCOPE
)
set
(
CMAKE_
${
lang
}
_SIMULATE_ID
"
${
CMAKE_
${
lang
}
_SIMULATE_ID
}
"
PARENT_SCOPE
)
set
(
CMAKE_
${
lang
}
_SIMULATE_VERSION
"
${
CMAKE_
${
lang
}
_SIMULATE_VERSION
}
"
PARENT_SCOPE
)
set
(
CMAKE_
${
lang
}
_STANDARD_COMPUTED_DEFAULT
"
${
CMAKE_
${
lang
}
_STANDARD_COMPUTED_DEFAULT
}
"
PARENT_SCOPE
)
...
...
@@ -435,6 +436,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
set
(
HAVE_COMPILER_VERSION_MINOR 0
)
set
(
HAVE_COMPILER_VERSION_PATCH 0
)
set
(
HAVE_COMPILER_VERSION_TWEAK 0
)
set
(
COMPILER_WRAPPER
)
set
(
DIGIT_VALUE_1 1
)
set
(
DIGIT_VALUE_2 10
)
set
(
DIGIT_VALUE_3 100
)
...
...
@@ -476,6 +478,9 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
endif
()
endforeach
()
endforeach
()
if
(
"
${
info
}
"
MATCHES
"INFO:compiler_wrapper
\\
[([^]
\"
]*)
\\
]"
)
set
(
COMPILER_WRAPPER
"
${
CMAKE_MATCH_1
}
"
)
endif
()
if
(
"
${
info
}
"
MATCHES
"INFO:simulate
\\
[([^]
\"
]*)
\\
]"
)
set
(
SIMULATE_ID
"
${
CMAKE_MATCH_1
}
"
)
endif
()
...
...
@@ -588,6 +593,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
set
(
MSVC_
${
lang
}
_ARCHITECTURE_ID
"
${
MSVC_
${
lang
}
_ARCHITECTURE_ID
}
"
PARENT_SCOPE
)
set
(
CMAKE_
${
lang
}
_COMPILER_VERSION
"
${
CMAKE_
${
lang
}
_COMPILER_VERSION
}
"
PARENT_SCOPE
)
set
(
CMAKE_
${
lang
}
_COMPILER_WRAPPER
"
${
COMPILER_WRAPPER
}
"
PARENT_SCOPE
)
set
(
CMAKE_
${
lang
}
_SIMULATE_ID
"
${
CMAKE_
${
lang
}
_SIMULATE_ID
}
"
PARENT_SCOPE
)
set
(
CMAKE_
${
lang
}
_SIMULATE_VERSION
"
${
CMAKE_
${
lang
}
_SIMULATE_VERSION
}
"
PARENT_SCOPE
)
set
(
CMAKE_EXECUTABLE_FORMAT
"
${
CMAKE_EXECUTABLE_FORMAT
}
"
PARENT_SCOPE
)
...
...
Modules/CMakeFortranCompiler.cmake.in
View file @
5eaac0c9
...
...
@@ -2,6 +2,7 @@ set(CMAKE_Fortran_COMPILER "@CMAKE_Fortran_COMPILER@")
set(CMAKE_Fortran_COMPILER_ARG1 "@CMAKE_Fortran_COMPILER_ARG1@")
set(CMAKE_Fortran_COMPILER_ID "@CMAKE_Fortran_COMPILER_ID@")
set(CMAKE_Fortran_COMPILER_VERSION "@CMAKE_Fortran_COMPILER_VERSION@")
set(CMAKE_Fortran_COMPILER_WRAPPER "@CMAKE_Fortran_COMPILER_WRAPPER@")
set(CMAKE_Fortran_PLATFORM_ID "@CMAKE_Fortran_PLATFORM_ID@")
set(CMAKE_Fortran_SIMULATE_ID "@CMAKE_Fortran_SIMULATE_ID@")
set(CMAKE_Fortran_SIMULATE_VERSION "@CMAKE_Fortran_SIMULATE_VERSION@")
...
...
Modules/CMakeFortranInformation.cmake
View file @
5eaac0c9
...
...
@@ -12,6 +12,8 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
include
(
CMakeLanguageInformation
)
# This file sets the basic flags for the Fortran language in CMake.
# It also loads the available platform file for the system-compiler
# if it exists.
...
...
@@ -36,6 +38,12 @@ if (NOT _INCLUDED_FILE)
include
(
Platform/
${
CMAKE_SYSTEM_NAME
}
-
${
CMAKE_BASE_NAME
}
OPTIONAL
RESULT_VARIABLE _INCLUDED_FILE
)
endif
()
# load any compiler-wrapper specific information
if
(
CMAKE_Fortran_COMPILER_WRAPPER
)
__cmake_include_compiler_wrapper
(
Fortran
)
endif
()
# We specify the compiler information in the system file for some
# platforms, but this language may not have been enabled when the file
# was first included. Include it again to get the language info.
...
...
Modules/CMakeLanguageInformation.cmake
0 → 100644
View file @
5eaac0c9
#=============================================================================
# Copyright 2015 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# This file contains common code blocks used by all the language information
# files
# load any compiler-wrapper specific information
macro
(
__cmake_include_compiler_wrapper lang
)
set
(
_INCLUDED_WRAPPER_FILE 0
)
if
(
CMAKE_
${
lang
}
_COMPILER_ID
)
include
(
Platform/
${
CMAKE_SYSTEM_NAME
}
-
${
CMAKE_
${
lang
}
_COMPILER_WRAPPER
}
-
${
CMAKE_
${
lang
}
_COMPILER_ID
}
-
${
lang
}
OPTIONAL RESULT_VARIABLE _INCLUDED_WRAPPER_FILE
)
endif
()
if
(
NOT _INCLUDED_WRAPPER_FILE
)
include
(
Platform/
${
CMAKE_SYSTEM_NAME
}
-
${
CMAKE_
${
lang
}
_COMPILER_WRAPPER
}
-
${
lang
}
OPTIONAL RESULT_VARIABLE _INCLUDED_WRAPPER_FILE
)
endif
()
# No platform - wrapper - lang information so maybe there's just wrapper - lang information
if
(
NOT _INCLUDED_WRAPPER_FILE
)
if
(
CMAKE_
${
lang
}
_COMPILER_ID
)
include
(
Compiler/
${
CMAKE_
${
lang
}
_COMPILER_WRAPPER
}
-
${
CMAKE_
${
lang
}
_COMPILER_ID
}
-
${
lang
}
OPTIONAL RESULT_VARIABLE _INCLUDED_WRAPPER_FILE
)
endif
()
if
(
NOT _INCLUDED_WRAPPER_FILE
)
include
(
Compiler/
${
CMAKE_
${
lang
}
_COMPILER_WRAPPER
}
-
${
lang
}
OPTIONAL RESULT_VARIABLE _INCLUDED_WRAPPER_FILE
)
endif
()
endif
()
endmacro
()
Brad King
@brad.king
mentioned in commit
ad1be6ee
·
Dec 09, 2015
mentioned in commit
ad1be6ee
mentioned in commit ad1be6ee769ecaba4d6dadae84c0fc372049a333
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment