diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -2003,6 +2003,7 @@ set(CMAKE_DSYMUTIL xcrun dsymutil) endif() add_custom_command(TARGET ${name} POST_BUILD + WORKING_DIRECTORY ${LLVM_RUNTIME_OUTPUT_INTDIR} COMMAND ${CMAKE_DSYMUTIL} ${output_path} $ ${strip_command} ) @@ -2020,6 +2021,7 @@ # If an output dir is specified, it must be manually mkdir'd on Linux, # as that directory needs to exist before we can pipe to a file in it. add_custom_command(TARGET ${name} POST_BUILD + WORKING_DIRECTORY ${LLVM_RUNTIME_OUTPUT_INTDIR} COMMAND ${CMAKE_COMMAND} -E make_directory ${LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR} ) else() @@ -2027,6 +2029,7 @@ endif() add_custom_command(TARGET ${name} POST_BUILD + WORKING_DIRECTORY ${LLVM_RUNTIME_OUTPUT_INTDIR} COMMAND ${CMAKE_OBJCOPY} --only-keep-debug $ ${output_path} ${strip_command} -R .gnu_debuglink COMMAND ${CMAKE_OBJCOPY} --add-gnu-debuglink=${output_path} $