Skip to content

Commit a29e623

Browse files
authored
[compiler-rt] Make add_custom_libcxx() resilient to DESTDIR being set
If DESTDIR is set in the environment during the build/test stage, the local libc++ installation will be installed under DESTDIR instead of being in the build directory. See #115077 (comment) and https://gitlab.kitware.com/cmake/cmake/-/issues/18165. Pull Request: #115525
1 parent e8ce76f commit a29e623

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler-rt/cmake/Modules/AddCompilerRT.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,9 @@ macro(add_custom_libcxx name prefix)
713713
USES_TERMINAL_INSTALL 1
714714
LIST_SEPARATOR |
715715
EXCLUDE_FROM_ALL TRUE
716+
# Ensure that DESTDIR=... set in the out environment does not affect this
717+
# target (we always need to install to the build directory).
718+
INSTALL_COMMAND env DESTDIR= ${CMAKE_COMMAND} --build ${prefix}/build --target install
716719
INSTALL_BYPRODUCTS "${prefix}/lib/libc++.a" "${prefix}/lib/libc++abi.a"
717720
)
718721

0 commit comments

Comments
 (0)