summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-config/llvm-config.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-config/llvm-config.cpp')
-rw-r--r--llvm/tools/llvm-config/llvm-config.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp
index 6c31df3e173b..fb12e29a36a8 100644
--- a/llvm/tools/llvm-config/llvm-config.cpp
+++ b/llvm/tools/llvm-config/llvm-config.cpp
@@ -46,6 +46,10 @@ using namespace llvm;
// create entries for pseudo groups like x86 or all-targets.
#include "LibraryDependencies.inc"
+// Built-in extensions also register their dependencies, but in a separate file,
+// later in the process.
+#include "ExtensionDependencies.inc"
+
// LinkMode determines what libraries and flags are returned by llvm-config.
enum LinkMode {
// LinkModeAuto will link with the default link mode for the installation,
@@ -110,6 +114,25 @@ static void VisitComponent(const std::string &Name,
GetComponentLibraryPath, Missing, DirSep);
}
+ // Special handling for the special 'extensions' component. Its content is
+ // not populated by llvm-build, but later in the process and loaded from
+ // ExtensionDependencies.inc.
+ if (Name == "extensions") {
+ for (auto const &AvailableExtension : AvailableExtensions) {
+ for (const char *const *Iter = &AvailableExtension.RequiredLibraries[0];
+ *Iter; ++Iter) {
+ AvailableComponent *AC = ComponentMap.lookup(*Iter);
+ if (!AC) {
+ RequiredLibs.push_back(*Iter);
+ } else {
+ VisitComponent(*Iter, ComponentMap, VisitedComponents, RequiredLibs,
+ IncludeNonInstalled, GetComponentNames,
+ GetComponentLibraryPath, Missing, DirSep);
+ }
+ }
+ }
+ }
+
if (GetComponentNames) {
RequiredLibs.push_back(Name);
return;