diff options
author | Mike McLaughlin <mikem@microsoft.com> | 2016-03-15 16:04:06 -0700 |
---|---|---|
committer | Mike McLaughlin <mikem@microsoft.com> | 2016-03-22 14:24:03 -0700 |
commit | 4efef62f0ead16b4f8ca2c6ccf0a77ce112f73b9 (patch) | |
tree | 97f19fefb5832f8e92f63b2cd7c09c43ac9b0904 /src/dlls | |
parent | 1a9eb1c5f4d9f257f3f96ef5205a0eb1a23395c3 (diff) | |
download | coreclr-4efef62f0ead16b4f8ca2c6ccf0a77ce112f73b9.tar.gz coreclr-4efef62f0ead16b4f8ca2c6ccf0a77ce112f73b9.tar.bz2 coreclr-4efef62f0ead16b4f8ca2c6ccf0a77ce112f73b9.zip |
Strip symbols on release builds into separate binaries
Issue #3669
Created a common cmake strip_symbols function that all the modules and programs
use to strip the symbols out of the main into a separate .dbg (Linux) or .dSYM (OSX)
file.
Added an install_clr cmake function to encapsulate the install logic.
Changed all the library module cmake install lines from a TARGETS to a FILES one. The
TARGETS based install directives caused cmake to relink the binary and copy the unstripped
version to the install path. Left the all programs like corerun or ildasm as TARGETS
installs because on OSX FILES type installs don't get marked as executable.
Need to use "get_property(strip_source_file TARGET ${targetName} PROPERTY LOCATION)" for
the older versions of cmake and "set(strip_source_file $<TARGET_FILE:${targetName}>)" on
newer versions (v3 or greater).
Diffstat (limited to 'src/dlls')
-rw-r--r-- | src/dlls/clretwrc/CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/dlls/dbgshim/CMakeLists.txt | 5 | ||||
-rw-r--r-- | src/dlls/mscordac/CMakeLists.txt | 5 | ||||
-rw-r--r-- | src/dlls/mscordbi/CMakeLists.txt | 5 | ||||
-rw-r--r-- | src/dlls/mscoree/coreclr/CMakeLists.txt | 8 |
5 files changed, 7 insertions, 22 deletions
diff --git a/src/dlls/clretwrc/CMakeLists.txt b/src/dlls/clretwrc/CMakeLists.txt index 36205b5fe1..b1f7a49088 100644 --- a/src/dlls/clretwrc/CMakeLists.txt +++ b/src/dlls/clretwrc/CMakeLists.txt @@ -20,8 +20,4 @@ add_library_clr(clretwrc SHARED ) # add the install targets -install (TARGETS clretwrc DESTINATION .) - -if(WIN32) - install (FILES ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/clretwrc.pdb DESTINATION PDB) -endif(WIN32) +install_clr(clretwrc)
\ No newline at end of file diff --git a/src/dlls/dbgshim/CMakeLists.txt b/src/dlls/dbgshim/CMakeLists.txt index 655cb0a28b..c3ebaf5d06 100644 --- a/src/dlls/dbgshim/CMakeLists.txt +++ b/src/dlls/dbgshim/CMakeLists.txt @@ -71,7 +71,4 @@ endif(WIN32) target_link_libraries(dbgshim ${DBGSHIM_LIBRARIES}) # add the install targets -install (TARGETS dbgshim DESTINATION .) -if(WIN32) - install (FILES ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/dbgshim.pdb DESTINATION PDB) -endif(WIN32) +install_clr(dbgshim) diff --git a/src/dlls/mscordac/CMakeLists.txt b/src/dlls/mscordac/CMakeLists.txt index ea655e77b8..9a28479fed 100644 --- a/src/dlls/mscordac/CMakeLists.txt +++ b/src/dlls/mscordac/CMakeLists.txt @@ -106,7 +106,4 @@ endif(WIN32) target_link_libraries(mscordaccore ${COREDAC_LIBRARIES}) # add the install targets -install (TARGETS mscordaccore DESTINATION .) -if(WIN32) - install (FILES ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/mscordaccore.pdb DESTINATION PDB) -endif(WIN32) +install_clr(mscordaccore)
\ No newline at end of file diff --git a/src/dlls/mscordbi/CMakeLists.txt b/src/dlls/mscordbi/CMakeLists.txt index 0c8a685b76..2748bdf4a2 100644 --- a/src/dlls/mscordbi/CMakeLists.txt +++ b/src/dlls/mscordbi/CMakeLists.txt @@ -95,7 +95,4 @@ elseif(CLR_CMAKE_PLATFORM_UNIX) endif(WIN32) # add the install targets -install (TARGETS mscordbi DESTINATION .) -if(WIN32) - install (FILES ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/mscordbi.pdb DESTINATION PDB) -endif(WIN32) +install_clr(mscordbi)
\ No newline at end of file diff --git a/src/dlls/mscoree/coreclr/CMakeLists.txt b/src/dlls/mscoree/coreclr/CMakeLists.txt index 2c57fb630e..78ec166065 100644 --- a/src/dlls/mscoree/coreclr/CMakeLists.txt +++ b/src/dlls/mscoree/coreclr/CMakeLists.txt @@ -140,7 +140,8 @@ if(WIN32) clr_unknown_arch() endif() - add_custom_command(TARGET coreclr + add_custom_command( + TARGET coreclr POST_BUILD COMMAND ${CMAKE_CXX_COMPILER} /P /EP /TP ${PREPROCESS_DEFINITIONS} ${INC_DIR} /Fi${CMAKE_CURRENT_BINARY_DIR}/daccess.i ${CLR_DIR}/src/debug/daccess/daccess.cpp COMMAND ${BuildToolsDir}/dactablegen.exe /dac:${CMAKE_CURRENT_BINARY_DIR}/daccess.i /pdb:${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/coreclr.pdb /dll:$<TARGET_FILE:coreclr> /bin:${CMAKE_CURRENT_BINARY_DIR}/wks.bin @@ -160,7 +161,4 @@ else() endif(WIN32) # add the install targets -install (TARGETS coreclr DESTINATION .) -if(WIN32) - install (FILES ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/coreclr.pdb DESTINATION PDB) -endif(WIN32) +install_clr(coreclr)
\ No newline at end of file |