[libc-commits] [PATCH] D105740: Remove `LIBC_INSTALL_PREFIX`

John Ericson via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Jul 9 14:46:36 PDT 2021


Ericson2314 created this revision.
Ericson2314 added reviewers: phosek, lebedev.ri, compnerd, nathanchance.
Herald added subscribers: libc-commits, mgorny.
Herald added a project: libc-project.
Ericson2314 requested review of this revision.

This matches the decision made in D99697 <https://reviews.llvm.org/D99697>.

It also shouldn't reintroduce the issue fixed in D99636 <https://reviews.llvm.org/D99636>.

The variable was originally introduced in
b22f448c21e718a3b6219df89169f38d436189c6 <https://reviews.llvm.org/rGb22f448c21e718a3b6219df89169f38d436189c6> but is not essential to that
change.

Once we finish adding `GnuInstallDirs` support in D100810 <https://reviews.llvm.org/D100810> and D99484 <https://reviews.llvm.org/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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D105740

Files:
  libc/CMakeLists.txt
  libc/lib/CMakeLists.txt


Index: libc/lib/CMakeLists.txt
===================================================================
--- libc/lib/CMakeLists.txt
+++ libc/lib/CMakeLists.txt
@@ -12,7 +12,7 @@
 
 install(
   TARGETS llvmlibc
-  ARCHIVE DESTINATION ${LIBC_INSTALL_PREFIX}/${LIBC_INSTALL_LIBRARY_DIR}
+  ARCHIVE DESTINATION "${LIBC_INSTALL_LIBRARY_DIR}"
   COMPONENT llvmlibc
 )
 
Index: libc/CMakeLists.txt
===================================================================
--- libc/CMakeLists.txt
+++ libc/CMakeLists.txt
@@ -14,8 +14,6 @@
 # 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)
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105740.357645.patch
Type: text/x-patch
Size: 815 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20210709/562660c1/attachment.bin>


More information about the libc-commits mailing list