ソースを参照

Store CMAKE_ASM_COMPILER_VERSION persistently

We already do this for other languages like C and CXX.
Norbert Lange 8 年 前
コミット
fea7d69dde
2 ファイル変更31 行追加13 行削除
  1. 2 0
      Modules/CMakeASMCompiler.cmake.in
  2. 29 13
      Modules/CMakeDetermineASMCompiler.cmake

+ 2 - 0
Modules/CMakeASMCompiler.cmake.in

@@ -7,8 +7,10 @@ set(CMAKE_ASM@ASM_DIALECT@_COMPILER_RANLIB "@_CMAKE_ASM_COMPILER_RANLIB@")
 set(CMAKE_LINKER "@CMAKE_LINKER@")
 set(CMAKE_ASM@ASM_DIALECT@_COMPILER_LOADED 1)
 set(CMAKE_ASM@ASM_DIALECT@_COMPILER_ID "@_CMAKE_ASM_COMPILER_ID@")
+set(CMAKE_ASM@ASM_DIALECT@_COMPILER_VERSION "@_CMAKE_ASM_COMPILER_VERSION@")
 set(CMAKE_ASM@ASM_DIALECT@_COMPILER_ENV_VAR "@_CMAKE_ASM_COMPILER_ENV_VAR@")
 
 set(CMAKE_ASM@ASM_DIALECT@_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
 set(CMAKE_ASM@ASM_DIALECT@_LINKER_PREFERENCE 0)
 
+@CMAKE_ASM_COMPILER_CUSTOM_CODE@

+ 29 - 13
Modules/CMakeDetermineASMCompiler.cmake

@@ -106,7 +106,13 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
 endif()
 
 if(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
-  message(STATUS "The ASM${ASM_DIALECT} compiler identification is ${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}")
+  if(CMAKE_ASM${ASM_DIALECT}_COMPILER_VERSION)
+    set(_version " ${CMAKE_ASM${ASM_DIALECT}_COMPILER_VERSION}")
+  else()
+    set(_version "")
+  endif()
+  message(STATUS "The ASM${ASM_DIALECT} compiler identification is ${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}${_version}")
+  unset(_version)
 else()
   message(STATUS "The ASM${ASM_DIALECT} compiler identification is unknown")
 endif()
@@ -152,20 +158,30 @@ else()
   message(STATUS "Didn't find assembler")
 endif()
 
-
-set(_CMAKE_ASM_COMPILER "${CMAKE_ASM${ASM_DIALECT}_COMPILER}")
-set(_CMAKE_ASM_COMPILER_ID "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}")
-set(_CMAKE_ASM_COMPILER_ARG1 "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARG1}")
-set(_CMAKE_ASM_COMPILER_ENV_VAR "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ENV_VAR}")
-set(_CMAKE_ASM_COMPILER_AR "${CMAKE_ASM${ASM_DIALECT}_COMPILER_AR}")
-set(_CMAKE_ASM_COMPILER_RANLIB "${CMAKE_ASM${ASM_DIALECT}_COMPILER_RANLIB}")
+foreach(_var
+    COMPILER
+    COMPILER_ID
+    COMPILER_ARG1
+    COMPILER_ENV_VAR
+    COMPILER_AR
+    COMPILER_RANLIB
+    COMPILER_VERSION
+    )
+  set(_CMAKE_ASM_${_var} "${CMAKE_ASM${ASM_DIALECT}_${_var}}")
+endforeach()
 
 # configure variables set in this file for fast reload later on
 configure_file(${CMAKE_ROOT}/Modules/CMakeASMCompiler.cmake.in
   ${CMAKE_PLATFORM_INFO_DIR}/CMakeASM${ASM_DIALECT}Compiler.cmake @ONLY)
 
-set(_CMAKE_ASM_COMPILER)
-set(_CMAKE_ASM_COMPILER_ARG1)
-set(_CMAKE_ASM_COMPILER_ENV_VAR)
-set(_CMAKE_ASM_COMPILER_AR)
-set(_CMAKE_ASM_COMPILER_RANLIB)
+foreach(_var
+    COMPILER
+    COMPILER_ID
+    COMPILER_ARG1
+    COMPILER_ENV_VAR
+    COMPILER_AR
+    COMPILER_RANLIB
+    COMPILER_VERSION
+    )
+  unset(_CMAKE_ASM_${_var})
+endforeach()