[cmake] Don't generate per-file "__SHORT_FILE__" defines on visual studio builds (#151167)
As reported on #150677 - this is preventing msbuild parallelization as cmake is repeatedly being updated
This commit is contained in:
parent
a7b58e74a0
commit
9a84c62da4
@ -58,16 +58,19 @@ function(llvm_process_sources OUT_VAR)
|
||||
set(sources ${ARG_UNPARSED_ARGUMENTS})
|
||||
llvm_check_source_file_list(${sources})
|
||||
|
||||
foreach(fn ${sources})
|
||||
get_filename_component(suf ${fn} EXT)
|
||||
if("${suf}" STREQUAL ".cpp" OR "${suf}" STREQUAL ".c")
|
||||
get_filename_component(short_name ${fn} NAME)
|
||||
set_property(
|
||||
SOURCE ${fn}
|
||||
APPEND
|
||||
PROPERTY COMPILE_DEFINITIONS __SHORT_FILE__="${short_name}")
|
||||
endif()
|
||||
endforeach()
|
||||
# Don't generate __SHORT_FILE__ on VS builds as it can prevent build parallelisation.
|
||||
if(NOT CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||
foreach(fn ${sources})
|
||||
get_filename_component(suf ${fn} EXT)
|
||||
if("${suf}" STREQUAL ".cpp" OR "${suf}" STREQUAL ".c")
|
||||
get_filename_component(short_name ${fn} NAME)
|
||||
set_property(
|
||||
SOURCE ${fn}
|
||||
APPEND
|
||||
PROPERTY COMPILE_DEFINITIONS __SHORT_FILE__="${short_name}")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
|
||||
# This adds .td and .h files to the Visual Studio solution:
|
||||
|
Loading…
x
Reference in New Issue
Block a user