Merge topic 'vs-graceful-empty-compiler'
705ae00 Quote ${CMAKE_<LANG>_COMPILER} while enabling a language 18a2537 CMakeDetermineCompilerId: Do not test vendor without a compiler
This commit is contained in:
commit
7938e589e3
@ -34,7 +34,7 @@ if(CMAKE_C_COMPILER_ID)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_BASE_NAME)
|
set(CMAKE_BASE_NAME)
|
||||||
get_filename_component(CMAKE_BASE_NAME ${CMAKE_C_COMPILER} NAME_WE)
|
get_filename_component(CMAKE_BASE_NAME "${CMAKE_C_COMPILER}" NAME_WE)
|
||||||
if(CMAKE_COMPILER_IS_GNUCC)
|
if(CMAKE_COMPILER_IS_GNUCC)
|
||||||
set(CMAKE_BASE_NAME gcc)
|
set(CMAKE_BASE_NAME gcc)
|
||||||
endif()
|
endif()
|
||||||
|
@ -34,7 +34,7 @@ if(CMAKE_CXX_COMPILER_ID)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_BASE_NAME)
|
set(CMAKE_BASE_NAME)
|
||||||
get_filename_component(CMAKE_BASE_NAME ${CMAKE_CXX_COMPILER} NAME_WE)
|
get_filename_component(CMAKE_BASE_NAME "${CMAKE_CXX_COMPILER}" NAME_WE)
|
||||||
# since the gnu compiler has several names force g++
|
# since the gnu compiler has several names force g++
|
||||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
set(CMAKE_BASE_NAME g++)
|
set(CMAKE_BASE_NAME g++)
|
||||||
|
@ -44,7 +44,7 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
|
|||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
# If the compiler is still unknown, try to query its vendor.
|
# If the compiler is still unknown, try to query its vendor.
|
||||||
if(NOT CMAKE_${lang}_COMPILER_ID)
|
if(CMAKE_${lang}_COMPILER AND NOT CMAKE_${lang}_COMPILER_ID)
|
||||||
CMAKE_DETERMINE_COMPILER_ID_VENDOR(${lang})
|
CMAKE_DETERMINE_COMPILER_ID_VENDOR(${lang})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -232,7 +232,7 @@ Id flags: ${testflags}
|
|||||||
else()
|
else()
|
||||||
if(COMMAND EXECUTE_PROCESS)
|
if(COMMAND EXECUTE_PROCESS)
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND ${CMAKE_${lang}_COMPILER}
|
COMMAND "${CMAKE_${lang}_COMPILER}"
|
||||||
${CMAKE_${lang}_COMPILER_ID_ARG1}
|
${CMAKE_${lang}_COMPILER_ID_ARG1}
|
||||||
${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
|
${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
|
||||||
${testflags}
|
${testflags}
|
||||||
@ -244,7 +244,7 @@ Id flags: ${testflags}
|
|||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
exec_program(
|
exec_program(
|
||||||
${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_COMPILER_ID_DIR}
|
"${CMAKE_${lang}_COMPILER}" ${CMAKE_${lang}_COMPILER_ID_DIR}
|
||||||
ARGS ${CMAKE_${lang}_COMPILER_ID_ARG1}
|
ARGS ${CMAKE_${lang}_COMPILER_ID_ARG1}
|
||||||
${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
|
${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
|
||||||
${testflags}
|
${testflags}
|
||||||
@ -476,7 +476,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
|
|||||||
set(flags ${CMAKE_${lang}_COMPILER_ID_VENDOR_FLAGS_${vendor}})
|
set(flags ${CMAKE_${lang}_COMPILER_ID_VENDOR_FLAGS_${vendor}})
|
||||||
set(regex ${CMAKE_${lang}_COMPILER_ID_VENDOR_REGEX_${vendor}})
|
set(regex ${CMAKE_${lang}_COMPILER_ID_VENDOR_REGEX_${vendor}})
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND ${CMAKE_${lang}_COMPILER}
|
COMMAND "${CMAKE_${lang}_COMPILER}"
|
||||||
${CMAKE_${lang}_COMPILER_ID_ARG1}
|
${CMAKE_${lang}_COMPILER_ID_ARG1}
|
||||||
${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
|
${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
|
||||||
${flags}
|
${flags}
|
||||||
|
@ -24,7 +24,7 @@ if(CMAKE_Fortran_COMPILER_ID)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_BASE_NAME)
|
set(CMAKE_BASE_NAME)
|
||||||
get_filename_component(CMAKE_BASE_NAME ${CMAKE_Fortran_COMPILER} NAME_WE)
|
get_filename_component(CMAKE_BASE_NAME "${CMAKE_Fortran_COMPILER}" NAME_WE)
|
||||||
# since the gnu compiler has several names force g++
|
# since the gnu compiler has several names force g++
|
||||||
if(CMAKE_COMPILER_IS_GNUG77)
|
if(CMAKE_COMPILER_IS_GNUG77)
|
||||||
set(CMAKE_BASE_NAME g77)
|
set(CMAKE_BASE_NAME g77)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user