Skip to content
Merged
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
12 changes: 11 additions & 1 deletion src/native/corehost/nethost/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,19 @@ install(FILES ../hostfxr.h DESTINATION corehost)
install(FILES nethost.h DESTINATION corehost)
install_with_stripped_symbols(nethost TARGETS corehost)

if (MSVC)
# We ship libnethost.lib as a static library for external consumption, so
# LTCG must be disabled to ensure that non-MSVC toolchains can work with it.

target_compile_options(libnethost PRIVATE /GL-)

string(REPLACE "/LTCG" "" CMAKE_STATIC_LINKER_FLAGS_RELEASE ${CMAKE_STATIC_LINKER_FLAGS_RELEASE})
string(REPLACE "/LTCG" "" CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO ${CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO})
endif()

# Only Windows creates a symbols file for static libs.
if (WIN32)
install_with_stripped_symbols(libnethost TARGETS corehost)
else()
install(TARGETS libnethost DESTINATION corehost)
endif(WIN32)
endif(WIN32)