[PATCH] D26025: [cmake] Support specifying the libdir suffix for runtimes separately
Michał Górny via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 27 01:59:25 PDT 2016
mgorny created this revision.
mgorny added a reviewer: beanz.
mgorny added a subscriber: llvm-commits.
Add LLVM_RUNTIMES_LIBDIR_SUFFIX cache variable to allow configuring
the libdir suffix for runtimes separately, and store its value in
LLVMConfig.
This change originates from https://reviews.llvm.org/D23752 which aimed to add the support for
this override in clang. The goal is to support sharing a common runtime
directory between multiple multilib variants of LLVM/clang.
For example, on a multilib amd64 system the 64-bit and 32-bit versions
of clang libraries could both use the same runtime. This is possible
because runtime consists of arch-independent headers and libraries that
are arch-suffixed already.
https://reviews.llvm.org/D26025
Files:
CMakeLists.txt
cmake/modules/LLVMConfig.cmake.in
docs/CMake.rst
Index: docs/CMake.rst
===================================================================
--- docs/CMake.rst
+++ docs/CMake.rst
@@ -196,6 +196,12 @@
installed. On a 64-bit architecture, one could use ``-DLLVM_LIBDIR_SUFFIX=64``
to install libraries to ``/usr/lib64``.
+**LLVM_RUNTIMES_LIBDIR_SUFFIX**:STRING
+ Extra suffix to append to the library directory where LLVM runtimes
+ are to be installed. Defaults to LLVM_LIBDIR_SUFFIX. One can override
+ it to share a single runtime directory between 64-bit and 32-bit LLVM
+ builds.
+
**CMAKE_C_FLAGS**:STRING
Extra flags to use when compiling C source files.
Index: cmake/modules/LLVMConfig.cmake.in
===================================================================
--- cmake/modules/LLVMConfig.cmake.in
+++ cmake/modules/LLVMConfig.cmake.in
@@ -51,6 +51,7 @@
set(LLVM_ON_WIN32 @LLVM_ON_WIN32@)
set(LLVM_LIBDIR_SUFFIX @LLVM_LIBDIR_SUFFIX@)
+set(LLVM_RUNTIMES_LIBDIR_SUFFIX @LLVM_RUNTIMES_LIBDIR_SUFFIX@)
set(LLVM_INCLUDE_DIRS "@LLVM_CONFIG_INCLUDE_DIRS@")
set(LLVM_LIBRARY_DIRS "@LLVM_CONFIG_LIBRARY_DIRS@")
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -242,6 +242,8 @@
endif()
set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
+set(LLVM_RUNTIMES_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE STRING
+ "Define suffix of library directory used to hold runtimes (32/64)")
set(LLVM_TOOLS_INSTALL_DIR "bin" CACHE STRING "Path for binary subdirectory (defaults to 'bin')")
mark_as_advanced(LLVM_TOOLS_INSTALL_DIR)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26025.75993.patch
Type: text/x-patch
Size: 1621 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161027/91ec36f7/attachment.bin>
More information about the llvm-commits
mailing list