llvm.org GIT mirror llvm / a71c036
[CMake] Respect CMAKE_STRIP and CMAKE_DSYMUTIL on apple platforms This allows overriding the strip and dsymutil tools, and updates iOS.cmake to do so. I've also added libtool to iOS.cmake, but it was already respecting CMAKE_LIBTOOL if set. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335900 91177308-0d34-0410-b5e6-96231b3b80d8 Justin Bogner 1 year, 3 months ago
2 changed file(s) with 35 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
15561556
15571557 if(NOT LLVM_EXTERNALIZE_DEBUGINFO_SKIP_STRIP)
15581558 if(APPLE)
1559 set(strip_command COMMAND xcrun strip -Sxl $)
1559 if(NOT CMAKE_STRIP)
1560 set(CMAKE_STRIP xcrun strip)
1561 endif()
1562 set(strip_command COMMAND ${CMAKE_STRIP} -Sxl $)
15601563 else()
15611564 set(strip_command COMMAND ${CMAKE_STRIP} -gx $)
15621565 endif()
15701573 set_property(TARGET ${name} APPEND_STRING PROPERTY
15711574 LINK_FLAGS " -Wl,-object_path_lto,${lto_object}")
15721575 endif()
1576 if(NOT CMAKE_DSYMUTIL)
1577 set(CMAKE_DSYMUTIL xcrun dsymutil)
1578 endif()
15731579 add_custom_command(TARGET ${name} POST_BUILD
1574 COMMAND xcrun dsymutil $
1580 COMMAND ${CMAKE_DSYMUTIL} $
15751581 ${strip_command}
15761582 )
15771583 else()
5252 SET(CMAKE_RANLIB ${CMAKE_RANLIB_val} CACHE FILEPATH "Ranlib")
5353 message(STATUS "Using ranlib ${CMAKE_RANLIB}")
5454 ENDIF()
55
56 IF(NOT CMAKE_STRIP)
57 execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find strip
58 OUTPUT_VARIABLE CMAKE_STRIP_val
59 ERROR_QUIET
60 OUTPUT_STRIP_TRAILING_WHITESPACE)
61 SET(CMAKE_STRIP ${CMAKE_STRIP_val} CACHE FILEPATH "Strip")
62 message(STATUS "Using strip ${CMAKE_STRIP}")
63 ENDIF()
64
65 IF(NOT CMAKE_DSYMUTIL)
66 execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find dsymutil
67 OUTPUT_VARIABLE CMAKE_DSYMUTIL_val
68 ERROR_QUIET
69 OUTPUT_STRIP_TRAILING_WHITESPACE)
70 SET(CMAKE_DSYMUTIL ${CMAKE_DSYMUTIL_val} CACHE FILEPATH "Dsymutil")
71 message(STATUS "Using dsymutil ${CMAKE_DSYMUTIL}")
72 ENDIF()
73
74 IF(NOT CMAKE_LIBTOOL)
75 execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find libtool
76 OUTPUT_VARIABLE CMAKE_LIBTOOL_val
77 ERROR_QUIET
78 OUTPUT_STRIP_TRAILING_WHITESPACE)
79 SET(CMAKE_LIBTOOL ${CMAKE_LIBTOOL_val} CACHE FILEPATH "Libtool")
80 message(STATUS "Using libtool ${CMAKE_LIBTOOL}")
81 ENDIF()