diff --git a/cmake/modules/AddPartiallyLinkedObject.cmake b/cmake/modules/AddPartiallyLinkedObject.cmake index fd5069d6786..c9d96de1b9a 100755 --- a/cmake/modules/AddPartiallyLinkedObject.cmake +++ b/cmake/modules/AddPartiallyLinkedObject.cmake @@ -13,7 +13,7 @@ macro(add_partially_linked_object lib) if( MSVC ) add_llvm_library( ${lib} ${ARGN}) else( MSVC ) - set(pll ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/${lib}.o) + set(pll ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${lib}.o) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/temp_lib) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/temp_lib) llvm_process_sources( ALL_FILES ${ARGN} ) @@ -27,7 +27,7 @@ macro(add_partially_linked_object lib) add_custom_command(OUTPUT ${pll} COMMENT "Building ${lib}.o..." DEPENDS ${lib} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/temp_lib + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/temp_lib/${CMAKE_CFG_INTDIR} COMMAND ar x ${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX} COMMAND ${CMAKE_LINKER} "${LLVM_PLO_FLAGS}" -r "*${CMAKE_CXX_OUTPUT_EXTENSION}" -o ${pll} COMMAND ${CMAKE_COMMAND} -E remove -f *${CMAKE_CXX_OUTPUT_EXTENSION} diff --git a/cmake/modules/LLVMConfig.cmake b/cmake/modules/LLVMConfig.cmake index 72c4dcafa47..63f9ded19fd 100755 --- a/cmake/modules/LLVMConfig.cmake +++ b/cmake/modules/LLVMConfig.cmake @@ -131,7 +131,7 @@ macro(nix_llvm_config executable) if(c MATCHES ".*\\.o") get_filename_component(fn ${c} NAME) target_link_libraries(${executable} - ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/${fn}) + ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${fn}) else(c MATCHES ".*\\.o") string(REPLACE "-l" "" fn ${c}) target_link_libraries(${executable} ${fn}) diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt index 00bfe2390de..94bce1af2ad 100644 --- a/tools/llvm-config/CMakeLists.txt +++ b/tools/llvm-config/CMakeLists.txt @@ -68,7 +68,7 @@ if( NOT NM_PATH ) endif() add_custom_command(OUTPUT ${LIBDEPS_TMP} - COMMAND ${PERL_EXECUTABLE} ${LLVM_MAIN_SRC_DIR}/utils/GenLibDeps.pl -flat ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} ${NM_PATH} > ${LIBDEPS_TMP} + COMMAND ${PERL_EXECUTABLE} ${LLVM_MAIN_SRC_DIR}/utils/GenLibDeps.pl -flat ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR} ${NM_PATH} > ${LIBDEPS_TMP} DEPENDS ${llvm_libs} COMMENT "Regenerating ${LIBDEPS_TMP}")