File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -58,14 +58,16 @@ function(llvm_process_sources OUT_VAR)
58
58
set (sources ${ARG_UNPARSED_ARGUMENTS} )
59
59
llvm_check_source_file_list (${sources} )
60
60
61
- foreach (fn ${sources} )
62
- get_filename_component (suf ${fn} EXT )
63
- if ("${suf} " STREQUAL ".cpp" OR "${suf} " STREQUAL ".c" )
64
- get_filename_component (short_name ${fn} NAME )
65
- set_source_files_properties (${fn} PROPERTIES COMPILE_DEFINITIONS "__SHORT_FILE__=\" ${short_name} \" " )
66
- endif ()
67
- endforeach ()
68
-
61
+ # Don't generate __SHORT_FILE__ on MSVC builds as it can force repeated cache regeneration.
62
+ if (NOT MSVC )
63
+ foreach (fn ${sources} )
64
+ get_filename_component (suf ${fn} EXT )
65
+ if ("${suf} " STREQUAL ".cpp" OR "${suf} " STREQUAL ".c" )
66
+ get_filename_component (short_name ${fn} NAME )
67
+ set_source_files_properties (${fn} PROPERTIES COMPILE_DEFINITIONS "__SHORT_FILE__=\" ${short_name} \" " )
68
+ endif ()
69
+ endforeach ()
70
+ endif ()
69
71
70
72
# This adds .td and .h files to the Visual Studio solution:
71
73
add_td_sources (sources )
You can’t perform that action at this time.
0 commit comments