diff --git a/compiler-rt/cmake/Modules/AddCompilerRT.cmake b/compiler-rt/cmake/Modules/AddCompilerRT.cmake index 6b96a5147753e..4873bec39f8af 100644 --- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake +++ b/compiler-rt/cmake/Modules/AddCompilerRT.cmake @@ -713,6 +713,9 @@ macro(add_custom_libcxx name prefix) USES_TERMINAL_INSTALL 1 LIST_SEPARATOR | EXCLUDE_FROM_ALL TRUE + # Ensure that DESTDIR=... set in the out environment does not affect this + # target (we always need to install to the build directory). + INSTALL_COMMAND env DESTDIR= ${CMAKE_COMMAND} --build ${prefix}/build --target install INSTALL_BYPRODUCTS "${prefix}/lib/libc++.a" "${prefix}/lib/libc++abi.a" )