Skip to content

Commit 61c1f6d

Browse files
authored
[cmake] Warn if LLVM_PROFDATA_FILE was specified but wasn't found (#139882)
Ideally we should perhaps even error out here; if the user requested building with profiling info, but that profile wasn't found, it seems like the build configuration is subtly broken, and I would expect the user to want to know about it. But that may be a too disruptive change, as users may very well rely on being able to build things in such a setup anyway thanks to Hyrum's Law. To make things clearer, at least print a warning in this case.
1 parent 8c43588 commit 61c1f6d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/cmake/modules/HandleLLVMOptions.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,6 +1240,8 @@ if(LLVM_PROFDATA_FILE AND EXISTS ${LLVM_PROFDATA_FILE})
12401240
else()
12411241
message(FATAL_ERROR "LLVM_PROFDATA_FILE can only be specified when compiling with clang")
12421242
endif()
1243+
elseif(LLVM_PROFDATA_FILE)
1244+
message(WARNING "LLVM_PROFDATA_FILE specified, but ${LLVM_PROFDATA_FILE} not found")
12431245
endif()
12441246

12451247
option(LLVM_BUILD_INSTRUMENTED_COVERAGE "Build LLVM and tools with Code Coverage instrumentation" Off)

0 commit comments

Comments
 (0)