summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaul Laasner <raullaasner@gmail.com>2018-09-26 11:32:48 -0400
committerBrad King <brad.king@kitware.com>2018-09-26 14:01:39 -0400
commit7ab5843c2672c3b6125cbda6c64d5071ac2031bb (patch)
tree44763c6c910bf6fe82ec83224e0da03be98952c6
parenta57225c4fc5cbbf063d86e0f911c552bc0fabb9d (diff)
downloadcmake-7ab5843c2672c3b6125cbda6c64d5071ac2031bb.tar.gz
ASM: Search for full path even when using C or C++ compiler
When `CMAKE_{C,CXX}_COMPILER` is set but `CMAKE_ASM*_COMPILER` is not, we copy the C or C++ compiler to use as the ASM compiler. In this case we still need to search for the ASM compiler in case the C or C++ compiler is not known as an absolute path. Also do not copy the compiler id setting and let the normal detection take place. The C compiler id may not exist if the language has not been enabled. Fixes: #18406
-rw-r--r--Modules/CMakeDetermineASMCompiler.cmake6
1 files changed, 2 insertions, 4 deletions
diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake
index 24048ed7ed..45dea8f788 100644
--- a/Modules/CMakeDetermineASMCompiler.cmake
+++ b/Modules/CMakeDetermineASMCompiler.cmake
@@ -22,11 +22,9 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
if("ASM${ASM_DIALECT}" STREQUAL "ASM") # the generic assembler support
if(NOT CMAKE_ASM_COMPILER_INIT)
if(CMAKE_C_COMPILER)
- set(CMAKE_ASM_COMPILER "${CMAKE_C_COMPILER}" CACHE FILEPATH "The ASM compiler")
- set(CMAKE_ASM_COMPILER_ID "${CMAKE_C_COMPILER_ID}")
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST ${CMAKE_C_COMPILER})
elseif(CMAKE_CXX_COMPILER)
- set(CMAKE_ASM_COMPILER "${CMAKE_CXX_COMPILER}" CACHE FILEPATH "The ASM compiler")
- set(CMAKE_ASM_COMPILER_ID "${CMAKE_CXX_COMPILER_ID}")
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST ${CMAKE_CXX_COMPILER})
else()
# List all default C and CXX compilers
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST