[PATCH] D127384: [cmake] Export driver template to fix standalone build
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 10 00:51:17 PDT 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
nikic marked an inline comment as done.
Closed by commit rG6bc8163c79fd: [cmake] Export driver template to fix standalone build (authored by nikic).
Changed prior to commit:
https://reviews.llvm.org/D127384?vs=435453&id=435820#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D127384/new/
https://reviews.llvm.org/D127384
Files:
llvm/cmake/driver-template.cpp.in
llvm/cmake/modules/AddLLVM.cmake
llvm/cmake/modules/CMakeLists.txt
llvm/cmake/modules/llvm-driver-template.cpp.in
Index: llvm/cmake/modules/CMakeLists.txt
===================================================================
--- llvm/cmake/modules/CMakeLists.txt
+++ llvm/cmake/modules/CMakeLists.txt
@@ -173,7 +173,8 @@
PATTERN LLVMConfigExtensions.cmake EXCLUDE
PATTERN LLVMConfigVersion.cmake EXCLUDE
PATTERN LLVM-Config.cmake EXCLUDE
- PATTERN GetHostTriple.cmake EXCLUDE)
+ PATTERN GetHostTriple.cmake EXCLUDE
+ PATTERN llvm-driver-template.cpp.in)
if (NOT LLVM_ENABLE_IDE)
# Add a dummy target so this can be used with LLVM_DISTRIBUTION_COMPONENTS
Index: llvm/cmake/modules/AddLLVM.cmake
===================================================================
--- llvm/cmake/modules/AddLLVM.cmake
+++ llvm/cmake/modules/AddLLVM.cmake
@@ -892,9 +892,14 @@
if (ARG_GENERATE_DRIVER)
string(REPLACE "-" "_" TOOL_NAME ${name})
- configure_file(
- ${LLVM_MAIN_SRC_DIR}/cmake/driver-template.cpp.in
- ${CMAKE_CURRENT_BINARY_DIR}/${name}-driver.cpp)
+ foreach(path ${CMAKE_MODULE_PATH})
+ if(EXISTS ${path}/llvm-driver-template.cpp.in)
+ configure_file(
+ ${path}/llvm-driver-template.cpp.in
+ ${CMAKE_CURRENT_BINARY_DIR}/${name}-driver.cpp)
+ break()
+ endif()
+ endforeach()
list(APPEND ALL_FILES ${CMAKE_CURRENT_BINARY_DIR}/${name}-driver.cpp)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127384.435820.patch
Type: text/x-patch
Size: 1339 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220610/f4b177b9/attachment.bin>
More information about the llvm-commits
mailing list