summaryrefslogtreecommitdiff
path: root/Modules/CMakeLanguageInformation.cmake
diff options
context:
space:
mode:
authorChuck Atkins <chuck.atkins@kitware.com>2015-12-02 08:47:43 -0600
committerChuck Atkins <chuck.atkins@kitware.com>2015-12-07 11:09:06 -0500
commit5eaac0c96ac51e1300664ef37239f3215bb58489 (patch)
tree6ee1af9c2d05d450430d99fa136e40fdd83ed26c /Modules/CMakeLanguageInformation.cmake
parent4e29a514ad83c5711e7ee894b825203e8c302269 (diff)
downloadcmake-5eaac0c96ac51e1300664ef37239f3215bb58489.tar.gz
Compiler: Add infrastructure for detecting compiler wrappers
Diffstat (limited to 'Modules/CMakeLanguageInformation.cmake')
-rw-r--r--Modules/CMakeLanguageInformation.cmake37
1 files changed, 37 insertions, 0 deletions
diff --git a/Modules/CMakeLanguageInformation.cmake b/Modules/CMakeLanguageInformation.cmake
new file mode 100644
index 0000000000..e03d149c0a
--- /dev/null
+++ b/Modules/CMakeLanguageInformation.cmake
@@ -0,0 +1,37 @@
+
+#=============================================================================
+# 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 ()