From 47550bb1d63621e9f902fbf6313062a8209989ed Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Wed, 9 May 2018 00:07:42 +0000 Subject: [PATCH] [CMake] Use CMAKE_OBJCOPY and CMAKE_STRIP to externalize debug info Don't hardcode objcopy and strip names, rather use CMAKE_OBJCOPY and CMAKE_STRIP variables which allows users to override the tools used such as using llvm-objcopy and llvm-strip instead of binutils versions. Differential Revision: https://reviews.llvm.org/D46611 llvm-svn: 331827 --- llvm/cmake/modules/AddLLVM.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake index a65b1ff..d631fcc 100644 --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -1546,7 +1546,7 @@ function(llvm_externalize_debuginfo name) if(APPLE) set(strip_command COMMAND xcrun strip -Sxl $) else() - set(strip_command COMMAND strip -gx $) + set(strip_command COMMAND ${CMAKE_STRIP} -gx $) endif() endif() @@ -1564,9 +1564,9 @@ function(llvm_externalize_debuginfo name) ) else() add_custom_command(TARGET ${name} POST_BUILD - COMMAND objcopy --only-keep-debug $ $.debug + COMMAND ${CMAKE_OBJCOPY} --only-keep-debug $ $.debug ${strip_command} -R .gnu_debuglink - COMMAND objcopy --add-gnu-debuglink=$.debug $ + COMMAND ${CMAKE_OBJCOPY} --add-gnu-debuglink=$.debug $ ) endif() endfunction() -- 2.7.4