1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

[CMake] Add LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR for custom dSYM target directory on Darwin

Summary: When using `LLVM_EXTERNALIZE_DEBUGINFO` in LLDB, the default dSYM location for the shared library in LLDB.framework is inside the framework bundle. With `LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR` we can easily fix that. I consider it a useful feature to be able to set a global output directory for external debug info (rather then having a target-specific one). Only implemented for Darwin so far.

Reviewers: beanz, aprantl

Reviewed By: aprantl

Subscribers: mgorny, aprantl, #lldb, lldb-commits, llvm-commits

Differential Revision: https://reviews.llvm.org/D55114

llvm-svn: 348118
This commit is contained in:
Stefan Granitz 2018-12-03 10:42:32 +00:00
parent 02c51ed077
commit e03d279ac1

View File

@ -1597,6 +1597,13 @@ function(llvm_externalize_debuginfo name)
endif()
endif()
if(LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR)
if(APPLE)
set(output_name "$<TARGET_FILE_NAME:${name}>.dSYM")
set(output_path "-o=${LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR}/${output_name}")
endif()
endif()
if(APPLE)
if(CMAKE_CXX_FLAGS MATCHES "-flto"
OR CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE} MATCHES "-flto")
@ -1609,7 +1616,7 @@ function(llvm_externalize_debuginfo name)
set(CMAKE_DSYMUTIL xcrun dsymutil)
endif()
add_custom_command(TARGET ${name} POST_BUILD
COMMAND ${CMAKE_DSYMUTIL} $<TARGET_FILE:${name}>
COMMAND ${CMAKE_DSYMUTIL} ${output_path} $<TARGET_FILE:${name}>
${strip_command}
)
else()