|
|
74755f |
--- a/src/settings.cmake
|
|
|
74755f |
+++ b/src/settings.cmake
|
|
|
74755f |
@@ -69,55 +69,10 @@
|
|
|
74755f |
endif (CMAKE_SYSTEM_NAME STREQUAL Darwin)
|
|
|
74755f |
endif ()
|
|
|
74755f |
|
|
|
74755f |
-function(strip_symbols targetName outputFilename)
|
|
|
74755f |
- if(CLR_CMAKE_PLATFORM_UNIX)
|
|
|
74755f |
- if(STRIP_SYMBOLS)
|
|
|
74755f |
-
|
|
|
74755f |
- # On the older version of cmake (2.8.12) used on Ubuntu 14.04 the TARGET_FILE
|
|
|
74755f |
- # generator expression doesn't work correctly returning the wrong path and on
|
|
|
74755f |
- # the newer cmake versions the LOCATION property isn't supported anymore.
|
|
|
74755f |
- if(CMAKE_VERSION VERSION_EQUAL 3.0 OR CMAKE_VERSION VERSION_GREATER 3.0)
|
|
|
74755f |
- set(strip_source_file $<TARGET_FILE:${targetName}>)
|
|
|
74755f |
- else()
|
|
|
74755f |
- get_property(strip_source_file TARGET ${targetName} PROPERTY LOCATION)
|
|
|
74755f |
- endif()
|
|
|
74755f |
-
|
|
|
74755f |
- if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
|
|
|
74755f |
- set(strip_destination_file ${strip_source_file}.dwarf)
|
|
|
74755f |
-
|
|
|
74755f |
- add_custom_command(
|
|
|
74755f |
- TARGET ${targetName}
|
|
|
74755f |
- POST_BUILD
|
|
|
74755f |
- VERBATIM
|
|
|
74755f |
- COMMAND ${DSYMUTIL} --flat --minimize ${strip_source_file}
|
|
|
74755f |
- COMMAND ${STRIP} -u -r ${strip_source_file}
|
|
|
74755f |
- COMMENT Stripping symbols from ${strip_source_file} into file ${strip_destination_file}
|
|
|
74755f |
- )
|
|
|
74755f |
- else(CMAKE_SYSTEM_NAME STREQUAL Darwin)
|
|
|
74755f |
- set(strip_destination_file ${strip_source_file}.dbg)
|
|
|
74755f |
-
|
|
|
74755f |
- add_custom_command(
|
|
|
74755f |
- TARGET ${targetName}
|
|
|
74755f |
- POST_BUILD
|
|
|
74755f |
- VERBATIM
|
|
|
74755f |
- COMMAND ${OBJCOPY} --only-keep-debug ${strip_source_file} ${strip_destination_file}
|
|
|
74755f |
- COMMAND ${OBJCOPY} --strip-unneeded ${strip_source_file}
|
|
|
74755f |
- COMMAND ${OBJCOPY} --add-gnu-debuglink=${strip_destination_file} ${strip_source_file}
|
|
|
74755f |
- COMMENT Stripping symbols from ${strip_source_file} into file ${strip_destination_file}
|
|
|
74755f |
- )
|
|
|
74755f |
- endif(CMAKE_SYSTEM_NAME STREQUAL Darwin)
|
|
|
74755f |
-
|
|
|
74755f |
- set(${outputFilename} ${strip_destination_file} PARENT_SCOPE)
|
|
|
74755f |
- endif(STRIP_SYMBOLS)
|
|
|
74755f |
- endif(CLR_CMAKE_PLATFORM_UNIX)
|
|
|
74755f |
-endfunction()
|
|
|
74755f |
-
|
|
|
74755f |
function(install_symbols targetName destination_path)
|
|
|
74755f |
if(WIN32)
|
|
|
74755f |
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/${targetName}.pdb DESTINATION ${destination_path})
|
|
|
74755f |
else()
|
|
|
74755f |
- strip_symbols(${targetName} strip_destination_file)
|
|
|
74755f |
- install(FILES ${strip_destination_file} DESTINATION ${destination_path})
|
|
|
74755f |
endif()
|
|
|
74755f |
endfunction()
|
|
|
74755f |
|