dotnet3.1/core-setup-do-not-strip.patch

59 lines
2.5 KiB
Diff
Raw Normal View History

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