[libc-commits] [libc] e7fe443 - Remove `LIBC_INSTALL_PREFIX`

John Ericson via libc-commits libc-commits at lists.llvm.org
Wed Jul 21 16:07:43 PDT 2021


Author: John Ericson
Date: 2021-07-21T23:07:36Z
New Revision: e7fe4433f822fc224b14c9988268f71aeb4d37f9

URL: https://github.com/llvm/llvm-project/commit/e7fe4433f822fc224b14c9988268f71aeb4d37f9
DIFF: https://github.com/llvm/llvm-project/commit/e7fe4433f822fc224b14c9988268f71aeb4d37f9.diff

LOG: Remove `LIBC_INSTALL_PREFIX`

This matches the decision made in D99697.

It also shouldn't reintroduce the issue fixed in D99636.

The variable was originally introduced in
b22f448c21e718a3b6219df89169f38d436189c6 but is not essential to that
change.

Once we finish adding `GnuInstallDirs` support in D100810 and D99484,
setting `CMAKE_INSTALL_LIBDIR` would also work to change the
installation directory (though for more than libc).

`GnuInstallDirs` support also brings up an issue which is avoided if
variables like `LIBC_INSTALL_PREFIX` don't exist. Because the
`GnuInstallDirs` variables can be absolute paths, it is a bit unclear
how the per-project prefixes would work: does the project-agnostic
role-specific variable (e.g. `CMAKE_INSTALL_LIBDIR`), or project-specfic
role-agnostic (e.g. `LIBC_INSTALL_PREFIX`) take priority? Each is more
specific than the other on one axis, but not the other.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D105740

Added: 
    

Modified: 
    libc/CMakeLists.txt
    libc/lib/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libc/CMakeLists.txt b/libc/CMakeLists.txt
index 5f891510fbb5..9e599be681ee 100644
--- a/libc/CMakeLists.txt
+++ b/libc/CMakeLists.txt
@@ -14,8 +14,6 @@ set(LIBC_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR})
 # Path libc/scripts directory.
 set(LIBC_BUILD_SCRIPTS_DIR "${LIBC_SOURCE_DIR}/utils/build_scripts")
 
-set(LIBC_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH "Define libc destination prefix.")
-
 set(LIBC_TARGET_OS ${CMAKE_SYSTEM_NAME})
 string(TOLOWER ${LIBC_TARGET_OS} LIBC_TARGET_OS)
 

diff  --git a/libc/lib/CMakeLists.txt b/libc/lib/CMakeLists.txt
index 7d99bd9cebf8..c5d48e8480f7 100644
--- a/libc/lib/CMakeLists.txt
+++ b/libc/lib/CMakeLists.txt
@@ -12,7 +12,7 @@ endif()
 
 install(
   TARGETS llvmlibc
-  ARCHIVE DESTINATION ${LIBC_INSTALL_PREFIX}/${LIBC_INSTALL_LIBRARY_DIR}
+  ARCHIVE DESTINATION "${LIBC_INSTALL_LIBRARY_DIR}"
   COMPONENT llvmlibc
 )
 


        


More information about the libc-commits mailing list