Index: libcxx/CMakeLists.txt =================================================================== --- libcxx/CMakeLists.txt +++ libcxx/CMakeLists.txt @@ -401,7 +401,6 @@ set(LIBCXX_HEADER_DIR ${LLVM_BINARY_DIR}) else() set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX}) - set(LIBCXX_HEADER_DIR ${CMAKE_BINARY_DIR}) endif() file(MAKE_DIRECTORY "${LIBCXX_BINARY_INCLUDE_DIR}") Index: libcxx/cmake/Modules/HandleLibCXXABI.cmake =================================================================== --- libcxx/cmake/Modules/HandleLibCXXABI.cmake +++ libcxx/cmake/Modules/HandleLibCXXABI.cmake @@ -48,7 +48,7 @@ COMMENT "Copying C++ ABI header ${fpath}...") list(APPEND abilib_headers "${dst}") - if (NOT LIBCXX_USING_INSTALLED_LLVM) + if (NOT LIBCXX_USING_INSTALLED_LLVM AND LIBCXX_HEADER_DIR) set(dst "${LIBCXX_HEADER_DIR}/include/c++/v1/${dstdir}/${fpath}") add_custom_command(OUTPUT ${dst} DEPENDS ${src} Index: libcxx/include/CMakeLists.txt =================================================================== --- libcxx/include/CMakeLists.txt +++ libcxx/include/CMakeLists.txt @@ -205,7 +205,7 @@ ) endif() -if(NOT LIBCXX_USING_INSTALLED_LLVM AND LLVM_BINARY_DIR) +if(NOT LIBCXX_USING_INSTALLED_LLVM AND LIBCXX_HEADER_DIR) set(output_dir ${LIBCXX_HEADER_DIR}/include/c++/v1) set(out_files)