llvm.org GIT mirror llvm / 8cea2af
[CMake] Support externalizing debug info on non-Darwin platforms On other platorms, we use objcopy to export the debug info. Differential Revision: https://reviews.llvm.org/D28575 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295481 91177308-0d34-0410-b5e6-96231b3b80d8 Petr Hosek 3 years ago
1 changed file(s) with 10 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
13861386 endif()
13871387
13881388 if(NOT LLVM_EXTERNALIZE_DEBUGINFO_SKIP_STRIP)
1389 set(strip_command COMMAND xcrun strip -Sxl $)
1389 if(APPLE)
1390 set(strip_command COMMAND xcrun strip -Sxl $)
1391 else()
1392 set(strip_command COMMAND strip -gx $)
1393 endif()
13901394 endif()
13911395
13921396 if(APPLE)
14021406 ${strip_command}
14031407 )
14041408 else()
1405 message(FATAL_ERROR "LLVM_EXTERNALIZE_DEBUGINFO isn't implemented for non-darwin platforms!")
1409 add_custom_command(TARGET ${name} POST_BUILD
1410 COMMAND objcopy --only-keep-debug $ $.debug
1411 ${strip_command} -R .gnu_debuglink
1412 COMMAND objcopy --add-gnu-debuglink=$.debug $
1413 )
14061414 endif()
14071415 endfunction()
14081416