summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCompilerId.cmake
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2010-08-15 14:36:38 (GMT)
committerAlex Neundorf <neundorf@kde.org>2010-08-15 14:36:38 (GMT)
commitb333779e34e6f9f68a2280830f8cf0ff3fdd39bf (patch)
treeecd92ea540924c86e89946bb4037c34f7428b0d6 /Modules/CMakeDetermineCompilerId.cmake
parent691fc2baa84dc73e76f8e6e6e555d807fd344f03 (diff)
downloadCMake-b333779e34e6f9f68a2280830f8cf0ff3fdd39bf.zip
CMake-b333779e34e6f9f68a2280830f8cf0ff3fdd39bf.tar.gz
CMake-b333779e34e6f9f68a2280830f8cf0ff3fdd39bf.tar.bz2
Detect a COMPILER_ID also for ASM.
For assembler, the "compiler ID" cannot be detected by "compiling" a source file, since there is not source file all assemblers understand. Instead the function CMAKE_DETERMINE_COMPILER_ID_VENDOR() is used to run the assembler and check its output. For this the CMAKE_DETERMINE_COMPILER_ID_VENDOR() function had to be extended so that it creates the run directory if it doesn't exist yet. In CMakeASMInformation.cmake now also CMAKE_ASM_COMPILER_ID is used (but there are no such files yet, will come with the support for the IAR toolchain). Alex
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake11
1 files changed, 11 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 836d9db..5fc2238 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -261,6 +261,17 @@ ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang)
# We try running the compiler with the flag for each vendor and
# matching its regular expression in the output.
FUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
+
+ IF(NOT CMAKE_${lang}_COMPILER_ID_DIR)
+ # We get here when this function is called not from within CMAKE_DETERMINE_COMPILER_ID()
+ # This is done e.g. for detecting the compiler ID for assemblers.
+ # Compute the directory in which to run the test and Create a clean working directory.
+ SET(CMAKE_${lang}_COMPILER_ID_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CompilerId${lang})
+ FILE(REMOVE_RECURSE ${CMAKE_${lang}_COMPILER_ID_DIR})
+ FILE(MAKE_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR})
+ ENDIF(NOT CMAKE_${lang}_COMPILER_ID_DIR)
+
+
FOREACH(vendor ${CMAKE_${lang}_COMPILER_ID_VENDORS})
SET(flags ${CMAKE_${lang}_COMPILER_ID_VENDOR_FLAGS_${vendor}})
SET(regex ${CMAKE_${lang}_COMPILER_ID_VENDOR_REGEX_${vendor}})