Skip to content

Commit 49439ff

Browse files
committed
[CMake] Fix ExtensionDependencies.inc with multiple extensions
When polly is enabled and LLVM_BYE_LINK_INTO_TOOLS=ON is on, ExtensionDependencies.inc does not compile. $ ninja tools/llvm-config/CMakeFiles/llvm-config.dir/llvm-config.cpp.o tools/llvm-config/ExtensionDependencies.inc:8:1: error: excess elements in struct initializer {{"Bye", {"Bye",nullptr}}}, ExtensionDependencies.inc pre-patch: std::array<ExtensionDescriptor, 2> AvailableExtensions{ {{"Polly", {"support", "core", ...,nullptr}}}, {{"Bye", {"Bye",nullptr}}}, }; ExtensionDependencies.inc with this patch: std::array<ExtensionDescriptor, 2> AvailableExtensions{ ExtensionDescriptor{"Polly", {"support", "core", ...,nullptr}}, ExtensionDescriptor{"Bye", {"Bye",nullptr}}, }; Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D91641
1 parent 67e0f79 commit 49439ff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/cmake/modules/AddLLVM.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ function(process_llvm_pass_plugins)
10751075
foreach(llvm_extension ${LLVM_STATIC_EXTENSIONS})
10761076
get_property(llvm_plugin_deps TARGET ${llvm_extension} PROPERTY LINK_LIBRARIES)
10771077

1078-
file(APPEND "${ExtensionDeps}.tmp" "{{\"${llvm_extension}\", {")
1078+
file(APPEND "${ExtensionDeps}.tmp" "ExtensionDescriptor{\"${llvm_extension}\", {")
10791079
foreach(llvm_plugin_dep ${llvm_plugin_deps})
10801080
# Turn library dependency back to component name, if possible.
10811081
# That way llvm-config can avoid redundant dependencies.
@@ -1089,7 +1089,7 @@ function(process_llvm_pass_plugins)
10891089
endforeach()
10901090

10911091
# Self + mandatory trailing null, because the number of RequiredLibraries differs between extensions.
1092-
file(APPEND "${ExtensionDeps}.tmp" \"${llvm_extension}\", "nullptr}}},\n")
1092+
file(APPEND "${ExtensionDeps}.tmp" \"${llvm_extension}\", "nullptr}},\n")
10931093
endforeach()
10941094
file(APPEND "${ExtensionDeps}.tmp" "};\n")
10951095

0 commit comments

Comments
 (0)