summaryrefslogtreecommitdiff
path: root/Modules/CMakeASMInformation.cmake
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2010-08-15 16:36:38 +0200
committerAlex Neundorf <neundorf@kde.org>2010-08-15 16:36:38 +0200
commitb333779e34e6f9f68a2280830f8cf0ff3fdd39bf (patch)
treeecd92ea540924c86e89946bb4037c34f7428b0d6 /Modules/CMakeASMInformation.cmake
parent691fc2baa84dc73e76f8e6e6e555d807fd344f03 (diff)
downloadcmake-b333779e34e6f9f68a2280830f8cf0ff3fdd39bf.tar.gz
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/CMakeASMInformation.cmake')
-rw-r--r--Modules/CMakeASMInformation.cmake21
1 files changed, 14 insertions, 7 deletions
diff --git a/Modules/CMakeASMInformation.cmake b/Modules/CMakeASMInformation.cmake
index 964a2a923c..b94303e8e0 100644
--- a/Modules/CMakeASMInformation.cmake
+++ b/Modules/CMakeASMInformation.cmake
@@ -28,18 +28,25 @@ IF("${CMAKE_BASE_NAME}" STREQUAL "as")
SET(CMAKE_BASE_NAME gas)
ENDIF("${CMAKE_BASE_NAME}" STREQUAL "as")
-INCLUDE(Platform/${CMAKE_BASE_NAME} OPTIONAL)
+# Load compiler-specific information.
+SET(_INCLUDED_FILE "")
+IF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
+ INCLUDE(Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
+ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
+IF(NOT _INCLUDED_FILE)
+ INCLUDE(Platform/${CMAKE_BASE_NAME} OPTIONAL)
+ENDIF(NOT _INCLUDED_FILE)
IF(CMAKE_SYSTEM_PROCESSOR)
- INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
+ INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
+ IF(NOT _INCLUDED_FILE)
+ INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
+ ENDIF(NOT _INCLUDED_FILE)
ENDIF(CMAKE_SYSTEM_PROCESSOR)
-IF(NOT _INCLUDED_FILE)
- INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-ASM-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
-ENDIF(NOT _INCLUDED_FILE)
-INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
+INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
IF(NOT _INCLUDED_FILE)
- INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-ASM OPTIONAL)
+ INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
ENDIF(NOT _INCLUDED_FILE)
# Set default assembler file extensions: