if(NOT LLVM_EXTERNALIZE_DEBUGINFO_SKIP_STRIP)
if(APPLE)
- set(strip_command COMMAND xcrun strip -Sxl $<TARGET_FILE:${name}>)
+ if(NOT CMAKE_STRIP)
+ set(CMAKE_STRIP xcrun strip)
+ endif()
+ set(strip_command COMMAND ${CMAKE_STRIP} -Sxl $<TARGET_FILE:${name}>)
else()
set(strip_command COMMAND ${CMAKE_STRIP} -gx $<TARGET_FILE:${name}>)
endif()
set_property(TARGET ${name} APPEND_STRING PROPERTY
LINK_FLAGS " -Wl,-object_path_lto,${lto_object}")
endif()
+ if(NOT CMAKE_DSYMUTIL)
+ set(CMAKE_DSYMUTIL xcrun dsymutil)
+ endif()
add_custom_command(TARGET ${name} POST_BUILD
- COMMAND xcrun dsymutil $<TARGET_FILE:${name}>
+ COMMAND ${CMAKE_DSYMUTIL} $<TARGET_FILE:${name}>
${strip_command}
)
else()
SET(CMAKE_RANLIB ${CMAKE_RANLIB_val} CACHE FILEPATH "Ranlib")
message(STATUS "Using ranlib ${CMAKE_RANLIB}")
ENDIF()
+
+IF(NOT CMAKE_STRIP)
+ execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find strip
+ OUTPUT_VARIABLE CMAKE_STRIP_val
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ SET(CMAKE_STRIP ${CMAKE_STRIP_val} CACHE FILEPATH "Strip")
+ message(STATUS "Using strip ${CMAKE_STRIP}")
+ENDIF()
+
+IF(NOT CMAKE_DSYMUTIL)
+ execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find dsymutil
+ OUTPUT_VARIABLE CMAKE_DSYMUTIL_val
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ SET(CMAKE_DSYMUTIL ${CMAKE_DSYMUTIL_val} CACHE FILEPATH "Dsymutil")
+ message(STATUS "Using dsymutil ${CMAKE_DSYMUTIL}")
+ENDIF()
+
+IF(NOT CMAKE_LIBTOOL)
+ execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT} -find libtool
+ OUTPUT_VARIABLE CMAKE_LIBTOOL_val
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ SET(CMAKE_LIBTOOL ${CMAKE_LIBTOOL_val} CACHE FILEPATH "Libtool")
+ message(STATUS "Using libtool ${CMAKE_LIBTOOL}")
+ENDIF()