Skip to content

Commit

Permalink
Publish hostfxr static library. (dotnet#46787)
Browse files Browse the repository at this point in the history
  • Loading branch information
rseanhall committed Jan 12, 2021
1 parent 891c6d3 commit a3aa75e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/installer/corehost/cli/fxr/standalone/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ else(CLR_CMAKE_TARGET_WIN32)
endif(CLR_CMAKE_TARGET_WIN32)

include(../../lib.cmake)
include(../../lib_static.cmake)

if(CLR_CMAKE_HOST_UNIX)
add_custom_target(hostfxr_exports DEPENDS ${EXPORTS_FILE})
Expand All @@ -37,5 +38,21 @@ if(CLR_CMAKE_HOST_UNIX)
set_property(TARGET hostfxr APPEND_STRING PROPERTY LINK_DEPENDS ${EXPORTS_FILE})
endif(CLR_CMAKE_HOST_UNIX)

# Copy static lib PDB to the project output directory
if (WIN32)
set_target_properties(libhostfxr PROPERTIES
COMPILE_PDB_NAME "libhostfxr"
COMPILE_PDB_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}"
)
endif(WIN32)

install_with_stripped_symbols(hostfxr TARGETS corehost)

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

target_link_libraries(hostfxr libhostcommon)
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
binaries that link against the static version. -->
<NativeBinary Include="$(DotNetHostBinDir)/libnethost.lib" />
<NativeBinary Include="$(DotNetHostBinDir)/PDB/libnethost.pdb" />
<NativeBinary Include="$(DotNetHostBinDir)/libhostfxr.lib" />
<NativeBinary Include="$(DotNetHostBinDir)/PDB/libhostfxr.pdb" />
</ItemGroup>
<ItemGroup Condition="'$(TargetOS)' != 'windows'">
<NativeBinary Include="$(DotNetHostBinDir)/$(LibPrefix)hostfxr$(StaticLibSuffix)" />
</ItemGroup>

<ItemGroup Condition="'$(PackageTargetRuntime)' != ''">
Expand Down

0 comments on commit a3aa75e

Please sign in to comment.