diff options
| author | Stefan Granitz <stefan.graenitz@gmail.com> | 2019-04-18 16:37:07 +0000 |
|---|---|---|
| committer | Stefan Granitz <stefan.graenitz@gmail.com> | 2019-04-18 16:37:07 +0000 |
| commit | ab58268fdaf59431f5f3cb0cfa451d7a6fa6e1ef (patch) | |
| tree | bfea06a28bffbce45129c75fc82e49e012f8a6ca | |
| parent | 92a7177e6b7f528d6c27ec6a5d2cd75077e8e864 (diff) | |
| download | bcm5719-llvm-ab58268fdaf59431f5f3cb0cfa451d7a6fa6e1ef.tar.gz bcm5719-llvm-ab58268fdaf59431f5f3cb0cfa451d7a6fa6e1ef.zip | |
[CMake] Allow custom extensions for externalized debug info
Summary:
Extra flexibility for emitting debug info to external files (remains Darwin only for now).
LLDB needs this functionality to emit a LLDB.framework.dSYM instead of LLDB.dSYM when building the framework, because the latter could conflict with the driver's lldb.dSYM when emitted in the same directory on case-insensitive file systems.
Reviewers: friss, bogner, beanz
Subscribers: mgorny, aprantl, llvm-commits, #lldb
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60862
llvm-svn: 358685
| -rw-r--r-- | llvm/cmake/modules/AddLLVM.cmake | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake index 41e263586b1..4287489507f 100644 --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -1604,14 +1604,21 @@ function(llvm_externalize_debuginfo name) endif() endif() - if(LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR) - if(APPLE) - set(output_name "$<TARGET_FILE_NAME:${name}>.dSYM") + if(APPLE) + if(LLVM_EXTERNALIZE_DEBUGINFO_EXTENSION) + set(file_ext ${LLVM_EXTERNALIZE_DEBUGINFO_EXTENSION}) + else() + set(file_ext dSYM) + endif() + + set(output_name "$<TARGET_FILE_NAME:${name}>.${file_ext}") + + if(LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR) set(output_path "-o=${LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR}/${output_name}") + else() + set(output_path "-o=${output_name}") endif() - endif() - if(APPLE) if(CMAKE_CXX_FLAGS MATCHES "-flto" OR CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE} MATCHES "-flto") |

