[PATCH] D11838: llvm-config: Add --build-system option
Tom Stellard via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 7 09:17:45 PDT 2015
tstellarAMD created this revision.
tstellarAMD added reviewers: echristo, chandlerc, beanz.
tstellarAMD added a subscriber: llvm-commits.
This can be used for distinguishing between cmake and autoconf builds.
Users may need this in order to handle inconsistencies between the
outputs of the two build systems.
http://reviews.llvm.org/D11838
Files:
tools/llvm-config/BuildVariables.inc.in
tools/llvm-config/CMakeLists.txt
tools/llvm-config/Makefile
tools/llvm-config/llvm-config.cpp
Index: tools/llvm-config/llvm-config.cpp
===================================================================
--- tools/llvm-config/llvm-config.cpp
+++ tools/llvm-config/llvm-config.cpp
@@ -157,6 +157,7 @@
--host-target Target triple used to configure LLVM.\n\
--build-mode Print build mode of LLVM tree (e.g. Debug or Release).\n\
--assertion-mode Print assertion mode of LLVM tree (ON or OFF).\n\
+ --build-system Print the build system used to build LLVM (autoconf or cmake).\n\
Typical components:\n\
all All LLVM libraries (default).\n\
engine Either a native JIT or a bitcode interpreter.\n";
@@ -323,6 +324,8 @@
#else
OS << "ON\n";
#endif
+ } else if (Arg == "--build-system") {
+ OS << LLVM_BUILD_SYSTEM << '\n';
} else if (Arg == "--obj-root") {
OS << ActivePrefix << '\n';
} else if (Arg == "--src-root") {
Index: tools/llvm-config/Makefile
===================================================================
--- tools/llvm-config/Makefile
+++ tools/llvm-config/Makefile
@@ -65,6 +65,8 @@
>> temp.sed
$(Verb) $(ECHO) 's/@LLVM_TARGETS_BUILT@/$(subst /,\/,$(TARGETS_TO_BUILD))/' \
>> temp.sed
+ $(Verb) $(ECHO) 's/@LLVM_BUILD_SYSTEM@/autoconf/' \
+ >> temp.sed
$(Verb) $(SED) -f temp.sed < $< > $@
$(Verb) $(RM) temp.sed
Index: tools/llvm-config/CMakeLists.txt
===================================================================
--- tools/llvm-config/CMakeLists.txt
+++ tools/llvm-config/CMakeLists.txt
@@ -16,6 +16,7 @@
set(LLVM_CPPFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_CPP_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
set(LLVM_CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
set(LLVM_CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
+set(LLVM_BUILD_SYSTEM cmake)
if (NOT LLVM_ENABLE_RTTI)
set(LLVM_CXXFLAGS "${LLVM_CXXFLAGS} -fno-rtti")
Index: tools/llvm-config/BuildVariables.inc.in
===================================================================
--- tools/llvm-config/BuildVariables.inc.in
+++ tools/llvm-config/BuildVariables.inc.in
@@ -26,3 +26,4 @@
#define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@"
#define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
#define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@"
+#define LLVM_BUILD_SYSTEM "@LLVM_BUILD_SYSTEM@"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11838.31522.patch
Type: text/x-patch
Size: 2400 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150807/a7e0c13d/attachment.bin>
More information about the llvm-commits
mailing list