summaryrefslogtreecommitdiff
path: root/Modules/CMakeDetermineASMCompiler.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/CMakeDetermineASMCompiler.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/CMakeDetermineASMCompiler.cmake')
-rw-r--r--Modules/CMakeDetermineASMCompiler.cmake19
1 files changed, 19 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake
index ae49fd3178..06dd6b86f9 100644
--- a/Modules/CMakeDetermineASMCompiler.cmake
+++ b/Modules/CMakeDetermineASMCompiler.cmake
@@ -57,6 +57,25 @@ IF (NOT _CMAKE_TOOLCHAIN_LOCATION)
GET_FILENAME_COMPONENT(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" PATH)
ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION)
+
+IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
+
+ # Table of per-vendor compiler id flags with expected output.
+ LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS GNU )
+ SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_GNU "--version")
+ SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_GNU "GNU assembler")
+
+ CMAKE_DETERMINE_COMPILER_ID_VENDOR(ASM${ASM_DIALECT})
+
+ IF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
+ MESSAGE(STATUS "The ASM${ASM_DIALECT} compiler identification is ${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}")
+ ELSE(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
+ MESSAGE(STATUS "The ASM${ASM_DIALECT} compiler identification is unknown")
+ ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
+
+ENDIF()
+
+
# If we have a gas/as cross compiler, they have usually some prefix, like
# e.g. powerpc-linux-gas, arm-elf-gas or i586-mingw32msvc-gas .
# The other tools of the toolchain usually have the same prefix