[llvm] [cmake] Don't generate per-file "__SHORT_FILE__" defines on MSVC builds (PR #151167)
Mehdi Amini via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 29 08:31:48 PDT 2025
================
@@ -58,14 +58,16 @@ 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_source_files_properties(${fn} PROPERTIES COMPILE_DEFINITIONS "__SHORT_FILE__=\"${short_name}\"")
- endif()
- endforeach()
-
+ # Don't generate __SHORT_FILE__ on MSVC builds as it can force repeated cache regeneration.
----------------
joker-eph wrote:
I mean you refer to a "cache", which cache? In general I think of "ccache" when I read this. If you mean that this triggers repeated cmake invocation, then why not write it as is?
You likely should be able to see which process is churning why things seem slow? If cmake is re-running that should be visible, and there should be no compilation job running concurrently?
https://github.com/llvm/llvm-project/pull/151167
More information about the llvm-commits
mailing list