endif(MSVC)
endfunction()
-function(strip_symbols targetName outputFilename)
+function(strip_symbols targetName outputFilename skipStrip)
if (CLR_CMAKE_PLATFORM_UNIX)
if (STRIP_SYMBOLS)
set(strip_source_file $<TARGET_FILE:${targetName}>)
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} -S ${strip_source_file}
- COMMENT Stripping symbols from ${strip_source_file} into file ${strip_destination_file}
- )
+ if(NOT ${skipStrip})
+ add_custom_command(
+ TARGET ${targetName}
+ POST_BUILD
+ VERBATIM
+ COMMAND ${DSYMUTIL} --flat --minimize ${strip_source_file}
+ COMMAND ${STRIP} -S ${strip_source_file}
+ COMMENT Stripping symbols from ${strip_source_file} into file ${strip_destination_file}
+ )
+ endif()
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-debug ${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}
- )
+ if(NOT ${skipStrip})
+ add_custom_command(
+ TARGET ${targetName}
+ POST_BUILD
+ VERBATIM
+ COMMAND ${OBJCOPY} --only-keep-debug ${strip_source_file} ${strip_destination_file}
+ COMMAND ${OBJCOPY} --strip-debug ${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()
endif (CMAKE_SYSTEM_NAME STREQUAL Darwin)
set(${outputFilename} ${strip_destination_file} PARENT_SCOPE)
endif(CLR_CMAKE_PLATFORM_UNIX)
endfunction()
-# install_clr(TARGETS TARGETS targetName [targetName2 ...] [DESTINATION destination])
+# install_clr(TARGETS TARGETS targetName [targetName2 ...] [DESTINATION destination] [SKIP_STRIP])
function(install_clr)
- set(options "")
+ set(options SKIP_STRIP)
set(oneValueArgs DESTINATION)
set(multiValueArgs TARGETS)
cmake_parse_arguments(PARSE_ARGV 0 INSTALL_CLR "${options}" "${oneValueArgs}" "${multiValueArgs}")
foreach(targetName ${INSTALL_CLR_TARGETS})
list(FIND CLR_CROSS_COMPONENTS_LIST ${targetName} INDEX)
if (NOT DEFINED CLR_CROSS_COMPONENTS_LIST OR NOT ${INDEX} EQUAL -1)
- strip_symbols(${targetName} strip_destination_file)
+ if("${INSTALL_CLR_SKIP_STRIP}" STREQUAL "")
+ set(INSTALL_CLR_SKIP_STRIP FALSE)
+ endif()
+ strip_symbols(${targetName} strip_destination_file ${INSTALL_CLR_SKIP_STRIP})
# We don't need to install the export libraries for our DLLs
# since they won't be directly linked against.