mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 21:31:08 -06:00
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
This commit is contained in:
@@ -22,11 +22,9 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
|
|||||||
if("ASM${ASM_DIALECT}" STREQUAL "ASM") # the generic assembler support
|
if("ASM${ASM_DIALECT}" STREQUAL "ASM") # the generic assembler support
|
||||||
if(NOT CMAKE_ASM_COMPILER_INIT)
|
if(NOT CMAKE_ASM_COMPILER_INIT)
|
||||||
if(CMAKE_C_COMPILER)
|
if(CMAKE_C_COMPILER)
|
||||||
set(CMAKE_ASM_COMPILER "${CMAKE_C_COMPILER}" CACHE FILEPATH "The ASM compiler")
|
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST ${CMAKE_C_COMPILER})
|
||||||
set(CMAKE_ASM_COMPILER_ID "${CMAKE_C_COMPILER_ID}")
|
|
||||||
elseif(CMAKE_CXX_COMPILER)
|
elseif(CMAKE_CXX_COMPILER)
|
||||||
set(CMAKE_ASM_COMPILER "${CMAKE_CXX_COMPILER}" CACHE FILEPATH "The ASM compiler")
|
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST ${CMAKE_CXX_COMPILER})
|
||||||
set(CMAKE_ASM_COMPILER_ID "${CMAKE_CXX_COMPILER_ID}")
|
|
||||||
else()
|
else()
|
||||||
# List all default C and CXX compilers
|
# List all default C and CXX compilers
|
||||||
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST
|
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST
|
||||||
|
|||||||
Reference in New Issue
Block a user