mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-12 17:19:05 -05:00
CMakeDetermineCompilerId: Make CMAKE_${lang}_COMPILER available earlier
If compiler id detection gave us the compiler tool, copy its value to
the `CMAKE_${lang}_COMPILER` variable as early as possible.
This commit is contained in:
@@ -46,6 +46,14 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Check if compiler id detection gave us the compiler tool.
|
||||
if(CMAKE_${lang}_COMPILER_ID_TOOL)
|
||||
set(CMAKE_${lang}_COMPILER "${CMAKE_${lang}_COMPILER_ID_TOOL}")
|
||||
set(CMAKE_${lang}_COMPILER "${CMAKE_${lang}_COMPILER_ID_TOOL}" PARENT_SCOPE)
|
||||
elseif(NOT CMAKE_${lang}_COMPILER)
|
||||
set(CMAKE_${lang}_COMPILER "CMAKE_${lang}_COMPILER-NOTFOUND" PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
# If the compiler is still unknown, try to query its vendor.
|
||||
if(CMAKE_${lang}_COMPILER AND NOT CMAKE_${lang}_COMPILER_ID)
|
||||
foreach(userflags "${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}" "")
|
||||
@@ -124,13 +132,6 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
|
||||
message(STATUS "The ${lang} compiler identification is unknown")
|
||||
endif()
|
||||
|
||||
# Check if compiler id detection gave us the compiler tool.
|
||||
if(CMAKE_${lang}_COMPILER_ID_TOOL)
|
||||
set(CMAKE_${lang}_COMPILER "${CMAKE_${lang}_COMPILER_ID_TOOL}" PARENT_SCOPE)
|
||||
elseif(NOT CMAKE_${lang}_COMPILER)
|
||||
set(CMAKE_${lang}_COMPILER "CMAKE_${lang}_COMPILER-NOTFOUND" PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
set(CMAKE_${lang}_COMPILER_ID "${CMAKE_${lang}_COMPILER_ID}" PARENT_SCOPE)
|
||||
set(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE)
|
||||
set(CMAKE_${lang}_COMPILER_ARCHITECTURE_ID "${CMAKE_${lang}_COMPILER_ARCHITECTURE_ID}" PARENT_SCOPE)
|
||||
|
||||
Reference in New Issue
Block a user