summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeCXXCompilerId.cpp.in
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-10-04 14:10:22 (GMT)
committerBrad King <brad.king@kitware.com>2013-10-04 17:25:06 (GMT)
commit51ab85c398319c074200ca51f37baa0e4c47ed7c (patch)
treef59e349ad80203504590265084463865832a3289 /Modules/CMakeCXXCompilerId.cpp.in
parentbe10826bf130d7568011ec3cf97355686c298dd3 (diff)
downloadCMake-51ab85c398319c074200ca51f37baa0e4c47ed7c.zip
CMake-51ab85c398319c074200ca51f37baa0e4c47ed7c.tar.gz
CMake-51ab85c398319c074200ca51f37baa0e4c47ed7c.tar.bz2
CMakeDetermineCompilerId: Add notion of "simulated" id/version
Some compilers try to simulate other compilers as a drop-in replacement supporting all the same command-line options and predefined preprocessor macros. In such cases it will be useful to have CMake load the compiler information files for the simulated compiler instead of duplicating the information. Teach CMakeDetermineCompilerId to extract the simulated compiler id and version when the compiler id detection provides it.
Diffstat (limited to 'Modules/CMakeCXXCompilerId.cpp.in')
-rw-r--r--Modules/CMakeCXXCompilerId.cpp.in9
1 files changed, 9 insertions, 0 deletions
diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in
index 5e87715..f4a4176 100644
--- a/Modules/CMakeCXXCompilerId.cpp.in
+++ b/Modules/CMakeCXXCompilerId.cpp.in
@@ -199,6 +199,9 @@
because some compilers will just produce instructions to fill the
array rather than assigning a pointer to a static array. */
char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
+#ifdef SIMULATE_ID
+char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
+#endif
@CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT@
@@ -212,6 +215,12 @@ int main(int argc, char* argv[])
#ifdef COMPILER_VERSION_MAJOR
require += info_version[argc];
#endif
+#ifdef SIMULATE_ID
+ require += info_simulate[argc];
+#endif
+#ifdef SIMULATE_VERSION_MAJOR
+ require += info_simulate_version[argc];
+#endif
(void)argv;
return require;
}