Skip to content

Commit 5268c17

Browse files
committedSep 9, 2015
llvm-config: Add --build-system option
Summary: 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. Reviewers: echristo, chandlerc, beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11838 llvm-svn: 247159
1 parent f71abef commit 5268c17

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed
 

‎llvm/tools/llvm-config/BuildVariables.inc.in

+1
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@
2626
#define LLVM_LIBDIR_SUFFIX "@LLVM_LIBDIR_SUFFIX@"
2727
#define LLVM_TARGETS_BUILT "@LLVM_TARGETS_BUILT@"
2828
#define LLVM_SYSTEM_LIBS "@LLVM_SYSTEM_LIBS@"
29+
#define LLVM_BUILD_SYSTEM "@LLVM_BUILD_SYSTEM@"

‎llvm/tools/llvm-config/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ set(LLVM_OBJ_ROOT ${LLVM_BINARY_DIR})
2424
set(LLVM_CPPFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_CPP_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
2525
set(LLVM_CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
2626
set(LLVM_CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${COMPILE_FLAGS} ${LLVM_DEFINITIONS}")
27+
set(LLVM_BUILD_SYSTEM cmake)
28+
2729
# Use the C++ link flags, since they should be a superset of C link flags.
2830
set(LLVM_LDFLAGS "${CMAKE_CXX_LINK_FLAGS}")
2931
set(LLVM_BUILDMODE ${CMAKE_BUILD_TYPE})

‎llvm/tools/llvm-config/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ $(ObjDir)/BuildVariables.inc: $(BUILDVARIABLES_SRCPATH) Makefile $(ObjDir)/.dir
6565
>> temp.sed
6666
$(Verb) $(ECHO) 's/@LLVM_TARGETS_BUILT@/$(subst /,\/,$(TARGETS_TO_BUILD))/' \
6767
>> temp.sed
68+
$(Verb) $(ECHO) 's/@LLVM_BUILD_SYSTEM@/autoconf/' \
69+
>> temp.sed
6870
$(Verb) $(SED) -f temp.sed < $< > $@
6971
$(Verb) $(RM) temp.sed
7072

‎llvm/tools/llvm-config/llvm-config.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ Options:\n\
157157
--host-target Target triple used to configure LLVM.\n\
158158
--build-mode Print build mode of LLVM tree (e.g. Debug or Release).\n\
159159
--assertion-mode Print assertion mode of LLVM tree (ON or OFF).\n\
160+
--build-system Print the build system used to build LLVM (autoconf or cmake).\n\
160161
Typical components:\n\
161162
all All LLVM libraries (default).\n\
162163
engine Either a native JIT or a bitcode interpreter.\n";
@@ -323,6 +324,8 @@ int main(int argc, char **argv) {
323324
#else
324325
OS << "ON\n";
325326
#endif
327+
} else if (Arg == "--build-system") {
328+
OS << LLVM_BUILD_SYSTEM << '\n';
326329
} else if (Arg == "--obj-root") {
327330
OS << ActivePrefix << '\n';
328331
} else if (Arg == "--src-root") {

0 commit comments

Comments
 (0)
Please sign in to comment.