[PATCH] D25743: Teach llvm-config about default sysroot.

Azharuddin Mohammed via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 18 12:56:03 PDT 2016


azharudd created this revision.
azharudd added reviewers: mgrang, apazos.
azharudd added a subscriber: llvm-commits.
azharudd set the repository for this revision to rL LLVM.
Herald added subscribers: mgorny, beanz.

Prints the default sysroot if it has been set.

Patch by Azharuddin Mohammed.


Repository:
  rL LLVM

https://reviews.llvm.org/D25743

Files:
  tools/llvm-config/BuildVariables.inc.in
  tools/llvm-config/CMakeLists.txt
  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
@@ -207,6 +207,7 @@
   --components      List of all possible components.\n\
   --targets-built   List of all targets currently built.\n\
   --host-target     Target triple used to configure LLVM.\n\
+  --default-sysroot Print the default sysroot.\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 (always cmake).\n\
@@ -519,6 +520,8 @@
         OS << '\n';
       } else if (Arg == "--targets-built") {
         OS << LLVM_TARGETS_BUILT << '\n';
+      } else if (Arg == "--default-sysroot") {
+        OS << LLVM_DEFAULT_SYSROOT << '\n';
       } else if (Arg == "--host-target") {
         OS << Triple::normalize(LLVM_DEFAULT_TARGET_TRIPLE) << '\n';
       } else if (Arg == "--build-mode") {
Index: tools/llvm-config/CMakeLists.txt
===================================================================
--- tools/llvm-config/CMakeLists.txt
+++ tools/llvm-config/CMakeLists.txt
@@ -53,6 +53,7 @@
   set(LLVM_ENABLE_SHARED OFF)
 endif()
 string(REPLACE ";" " " LLVM_TARGETS_BUILT "${LLVM_TARGETS_TO_BUILD}")
+set(LLVM_DEFAULT_SYSROOT ${DEFAULT_SYSROOT})
 configure_file(${BUILDVARIABLES_SRCPATH} ${BUILDVARIABLES_OBJPATH} @ONLY)
 
 # Set build-time environment(s).
Index: tools/llvm-config/BuildVariables.inc.in
===================================================================
--- tools/llvm-config/BuildVariables.inc.in
+++ tools/llvm-config/BuildVariables.inc.in
@@ -34,3 +34,4 @@
 #define LLVM_DYLIB_COMPONENTS "@LLVM_DYLIB_COMPONENTS@"
 #define LLVM_DYLIB_VERSION "@LLVM_DYLIB_VERSION@"
 #define LLVM_HAS_GLOBAL_ISEL "@LLVM_HAS_GLOBAL_ISEL@"
+#define LLVM_DEFAULT_SYSROOT "@LLVM_DEFAULT_SYSROOT@"


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25743.75056.patch
Type: text/x-patch
Size: 1955 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161018/923bdf4e/attachment.bin>


More information about the llvm-commits mailing list