Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions eng/native/functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -373,11 +373,11 @@ function (get_symbol_file_name targetName outputSymbolFilename)
endif ()

set(${outputSymbolFilename} ${strip_destination_file} PARENT_SCOPE)
else(CLR_CMAKE_HOST_UNIX)
elseif(CLR_CMAKE_HOST_WIN32)
# We can't use the $<TARGET_PDB_FILE> generator expression here since
# the generator expression isn't supported on resource DLLs.
set(${outputSymbolFilename} $<TARGET_FILE_DIR:${targetName}>/$<TARGET_FILE_PREFIX:${targetName}>$<TARGET_FILE_BASE_NAME:${targetName}>.pdb PARENT_SCOPE)
endif(CLR_CMAKE_HOST_UNIX)
endif()
endfunction()

function(strip_symbols targetName outputFilename)
Expand Down Expand Up @@ -443,7 +443,9 @@ endfunction()
function(install_with_stripped_symbols targetName kind destination)
if(NOT CLR_CMAKE_KEEP_NATIVE_SYMBOLS)
strip_symbols(${targetName} symbol_file)
install_symbol_file(${symbol_file} ${destination} ${ARGN})
if (NOT "${symbol_file}" STREQUAL "")
install_symbol_file(${symbol_file} ${destination} ${ARGN})
endif()
endif()

if (CLR_CMAKE_TARGET_APPLE AND ("${kind}" STREQUAL "TARGETS"))
Expand Down
1 change: 1 addition & 0 deletions src/mono/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ project(mono)

include(../../eng/native/configurepaths.cmake)
include(${CLR_ENG_NATIVE_DIR}/functions.cmake)
include(${CLR_ENG_NATIVE_DIR}/configuretools.cmake)

if (MSVC)
# Also set by configurecompiler.cmake, which isn't used by mono yet
Expand Down
2 changes: 1 addition & 1 deletion src/mono/dlls/dbgshim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ if(CLR_CMAKE_HOST_UNIX)
endif()

target_link_libraries(dbgshim PRIVATE ${DBGSHIM_LIBRARIES} monoapi)
install(TARGETS dbgshim DESTINATION lib)
install_with_stripped_symbols(dbgshim TARGETS lib)
2 changes: 1 addition & 1 deletion src/mono/dlls/mscordbi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,4 @@ if(CLR_CMAKE_HOST_UNIX)
endif()

target_link_libraries(mscordbi PRIVATE ${COREDBI_LIBRARIES} monoapi)
install(TARGETS mscordbi DESTINATION lib)
install_with_stripped_symbols(mscordbi TARGETS lib)
107 changes: 35 additions & 72 deletions src/mono/mono.proj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/mono/mono/component/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ if(NOT DISABLE_COMPONENTS AND NOT STATIC_COMPONENTS)
target_link_libraries("mono-component-${component}" PRIVATE monosgen-shared)
endif()
target_link_libraries("mono-component-${component}" PRIVATE ${OS_LIBS})
install(TARGETS "mono-component-${component}" LIBRARY)
install_with_stripped_symbols("mono-component-${component}" TARGETS lib)
endforeach()

#define a library for each component and component stub
Expand Down
2 changes: 1 addition & 1 deletion src/mono/mono/eventpipe/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if(ENABLE_PERFTRACING)
if(ICU_LDFLAGS)
set_target_properties(ep-test PROPERTIES LINK_FLAGS ${ICU_LDFLAGS})
endif()
install(TARGETS ep-test RUNTIME)
install_with_stripped_symbols(ep-test TARGETS bin)
else(ENABLE_EVENTPIPE_TEST AND STATIC_COMPONENTS AND (NOT DISABLE_COMPONENTS) AND (NOT DISABLE_LIBS) AND (NOT DISABLE_EXECUTABLES))
message(VERBOSE "Skip building native EventPipe library test runner.")
endif(ENABLE_EVENTPIPE_TEST AND STATIC_COMPONENTS AND (NOT DISABLE_COMPONENTS) AND (NOT DISABLE_LIBS) AND (NOT DISABLE_EXECUTABLES))
Expand Down
1 change: 0 additions & 1 deletion src/mono/mono/metadata/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,3 @@ target_compile_definitions(metadata_objects PRIVATE -DMONO_DLL_EXPORT)
target_include_directories(metadata_objects PRIVATE ${PROJECT_BINARY_DIR}/../..
${PROJECT_SOURCE_DIR}/../..
${PROJECT_SOURCE_DIR}/..)

11 changes: 3 additions & 8 deletions src/mono/mono/mini/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ if(NOT DISABLE_SHARED_LIBS)
# if components are disabled, link the fallback stubs into the runtime
target_sources(monosgen-shared PRIVATE "${mono-components-stub-objects}")
endif()
install(TARGETS monosgen-shared LIBRARY)
install_with_stripped_symbols(monosgen-shared TARGETS lib)
if(HOST_WIN32 AND TARGET_AMD64)
add_library(monosgen-shared-dac SHARED "mini-windows-dlldac.c")
target_link_libraries(monosgen-shared-dac PRIVATE monoapi eglib_api)
Expand Down Expand Up @@ -452,9 +452,7 @@ if(NOT DISABLE_SHARED_LIBS)
FRAMEWORK_VERSION C
MACOSX_FRAMEWORK_IDENTIFIER net.dot.mono-framework
)
install(TARGETS ${frameworkconfig}
FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
install_with_stripped_symbols(${frameworkconfig} TARGETS ${CMAKE_INSTALL_LIBDIR})
endforeach()
endif()
endif()
Expand Down Expand Up @@ -567,8 +565,5 @@ if(NOT DISABLE_EXECUTABLES)
target_sources(mono-sgen PRIVATE ${mono_validate_apis_source})
endif()

install(TARGETS mono-sgen RUNTIME)
if(HOST_WIN32)
install(FILES $<TARGET_PDB_FILE:mono-sgen> DESTINATION bin OPTIONAL)
endif()
install_with_stripped_symbols(mono-sgen TARGETS bin)
endif()