summaryrefslogtreecommitdiff
path: root/Modules/CMakeCCompilerId.c.in
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-10-04 10:10:22 -0400
committerBrad King <brad.king@kitware.com>2013-10-04 13:25:06 -0400
commit51ab85c398319c074200ca51f37baa0e4c47ed7c (patch)
treef59e349ad80203504590265084463865832a3289 /Modules/CMakeCCompilerId.c.in
parentbe10826bf130d7568011ec3cf97355686c298dd3 (diff)
downloadcmake-51ab85c398319c074200ca51f37baa0e4c47ed7c.tar.gz
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/CMakeCCompilerId.c.in')
-rw-r--r--Modules/CMakeCCompilerId.c.in9
1 files changed, 9 insertions, 0 deletions
diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in
index 66a5582650..48b46fa429 100644
--- a/Modules/CMakeCCompilerId.c.in
+++ b/Modules/CMakeCCompilerId.c.in
@@ -206,6 +206,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_C_COMPILER_ID_PLATFORM_CONTENT@
@@ -223,6 +226,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;
}