diff options
author | Daniel Dunbar <daniel@zuster.org> | 2011-12-16 00:04:43 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2011-12-16 00:04:43 +0000 |
commit | 275dd94afedd3b7331e5e93c9bbadac9a0415798 (patch) | |
tree | 342671386d2dca5cc4e6328909399ce86920c9d6 /tools/llvm-config | |
parent | b6744db06f088e1c8a8563c0cb6c202de9ef8aaa (diff) | |
download | external_llvm-275dd94afedd3b7331e5e93c9bbadac9a0415798.zip external_llvm-275dd94afedd3b7331e5e93c9bbadac9a0415798.tar.gz external_llvm-275dd94afedd3b7331e5e93c9bbadac9a0415798.tar.bz2 |
llvm-config: Fix --targets-built, I changed this to use the registry but wasn't
properly initializing the target infos. I decided it wasn't worth linking them
in for this, so just switched back to using the Makefile variable for now. We
can reconsider later if we ever get pluggable targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146711 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-config')
-rw-r--r-- | tools/llvm-config/BuildVariables.inc.in | 1 | ||||
-rw-r--r-- | tools/llvm-config/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tools/llvm-config/Makefile | 2 | ||||
-rw-r--r-- | tools/llvm-config/llvm-config.cpp | 10 |
4 files changed, 5 insertions, 9 deletions
diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in index 5969772..fe87afb 100644 --- a/tools/llvm-config/BuildVariables.inc.in +++ b/tools/llvm-config/BuildVariables.inc.in @@ -23,4 +23,5 @@ #define LLVM_LDFLAGS "@LLVM_LDFLAGS@" #define LLVM_CXXFLAGS "@LLVM_CXXFLAGS@" #define LLVM_BUILDMODE "@LLVM_BUILDMODE@" +#define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@" #define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@" diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt index ed26ba9..5ad58bf 100644 --- a/tools/llvm-config/CMakeLists.txt +++ b/tools/llvm-config/CMakeLists.txt @@ -27,6 +27,7 @@ add_custom_command(OUTPUT ${BUILDVARIABLES_OBJPATH} COMMAND echo s!@LLVM_LDFLAGS@!${CMAKE_SHARED_LINKER_FLAGS}! >> ${SEDSCRIPT_OBJPATH} COMMAND echo s!@LLVM_BUILDMODE@!${CMAKE_BUILD_TYPE}! >> ${SEDSCRIPT_OBJPATH} COMMAND echo s!@LLVM_SYSTEM_LIBS@!${SYSTEM_LIBS}! >> ${SEDSCRIPT_OBJPATH} + COMMAND echo s!@LLVM_TARGETS_BUILT@!${LLVM_TARGETS_TO_BUILD}! >> ${SEDSCRIPT_OBJPATH} COMMAND sed -f ${SEDSCRIPT_OBJPATH} < ${BUILDVARIABLES_SRCPATH} > ${BUILDVARIABLES_OBJPATH} VERBATIM COMMENT "Building BuildVariables.inc include." diff --git a/tools/llvm-config/Makefile b/tools/llvm-config/Makefile index a7a2a63..3f11730 100644 --- a/tools/llvm-config/Makefile +++ b/tools/llvm-config/Makefile @@ -53,5 +53,7 @@ $(ObjDir)/BuildVariables.inc: $(BUILDVARIABLES_SRCPATH) Makefile $(ObjDir)/.dir >> temp.sed $(Verb) $(ECHO) 's/@LLVM_SYSTEM_LIBS@/$(subst /,\/,$(LIBS))/' \ >> temp.sed + $(Verb) $(ECHO) 's/@LLVM_TARGETS_BUILT@/$(subst /,\/,$(TARGETS_TO_BUILD))/' \ + >> temp.sed $(Verb) $(SED) -f temp.sed < $< > $@ $(Verb) $(RM) temp.sed diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp index 4b61799..2bb0aeb 100644 --- a/tools/llvm-config/llvm-config.cpp +++ b/tools/llvm-config/llvm-config.cpp @@ -25,7 +25,6 @@ #include "llvm/Config/llvm-config.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/Path.h" -#include "llvm/Support/TargetRegistry.h" #include "llvm/Support/raw_ostream.h" #include <cstdlib> #include <set> @@ -271,14 +270,7 @@ int main(int argc, char **argv) { } OS << '\n'; } else if (Arg == "--targets-built") { - bool First = true; - for (TargetRegistry::iterator I = TargetRegistry::begin(), - E = TargetRegistry::end(); I != E; First = false, ++I) { - if (!First) - OS << ' '; - OS << I->getName(); - } - OS << '\n'; + OS << LLVM_TARGETS_BUILT << '\n'; } else if (Arg == "--host-target") { OS << LLVM_DEFAULT_TARGET_TRIPLE << '\n'; } else if (Arg == "--build-mode") { |