Publish nethost static library (#296)
authorNext Turn <45985406+NextTurn@users.noreply.github.com>
Mon, 9 Dec 2019 20:21:25 +0000 (04:21 +0800)
committerDavis Goodin <dagood@users.noreply.github.com>
Mon, 9 Dec 2019 20:21:25 +0000 (14:21 -0600)
src/installer/Directory.Build.props
src/installer/corehost/cli/lib_static.cmake [new file with mode: 0644]
src/installer/corehost/cli/nethost/CMakeLists.txt
src/installer/pkg/packaging/installers.proj
src/installer/pkg/projects/Microsoft.NETCore.DotNetAppHost/runtime.FreeBSD.Microsoft.NETCore.DotNetAppHost.props
src/installer/pkg/projects/Microsoft.NETCore.DotNetAppHost/runtime.OSX.Microsoft.NETCore.DotNetAppHost.props
src/installer/pkg/projects/Microsoft.NETCore.DotNetAppHost/runtime.Unix.Microsoft.NETCore.DotNetAppHost.props
src/installer/pkg/projects/Microsoft.NETCore.DotNetAppHost/runtime.Windows_NT.Microsoft.NETCore.DotNetAppHost.props

index d6cda92..0fb04e3 100644 (file)
     <LibSuffix>.so</LibSuffix> 
     <LibSuffix Condition="'$(OSGroup)' == 'Windows_NT'">.dll</LibSuffix>
     <LibSuffix Condition="'$(OSGroup)' == 'OSX'">.dylib</LibSuffix>
+    <StaticLibPrefix>lib</StaticLibPrefix>
+    <StaticLibSuffix>.a</StaticLibSuffix>
+    <StaticLibSuffix Condition="'$(OSGroup)' == 'Windows_NT'">.lib</StaticLibSuffix>
   </PropertyGroup>
 
   <PropertyGroup>
diff --git a/src/installer/corehost/cli/lib_static.cmake b/src/installer/corehost/cli/lib_static.cmake
new file mode 100644 (file)
index 0000000..6c4b503
--- /dev/null
@@ -0,0 +1,18 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+project(lib${DOTNET_PROJECT_NAME})
+
+include(${CMAKE_CURRENT_LIST_DIR}/common.cmake)
+
+add_definitions(-D_NO_ASYNCRTIMP)
+add_definitions(-D_NO_PPLXIMP)
+add_definitions(-DEXPORT_SHARED_API=1)
+
+add_library(lib${DOTNET_PROJECT_NAME} STATIC ${SOURCES} ${RESOURCES})
+
+set_target_properties(lib${DOTNET_PROJECT_NAME} PROPERTIES MACOSX_RPATH TRUE)
+set_target_properties(lib${DOTNET_PROJECT_NAME} PROPERTIES PREFIX "")
+
+set_common_libs("lib")
index b56650b..7473958 100644 (file)
@@ -23,10 +23,12 @@ if(WIN32)
 endif()
 
 include(../lib.cmake)
+include(../lib_static.cmake)
 
 add_definitions(-DFEATURE_LIBHOST=1)
 add_definitions(-DNETHOST_EXPORT)
 
 install(FILES nethost.h DESTINATION corehost)
 install(TARGETS nethost DESTINATION corehost)
+install(TARGETS libnethost DESTINATION corehost)
 install_symbols(nethost corehost)
\ No newline at end of file
index 56a8259..21736cb 100644 (file)
     <ItemGroup>
       <NetHostFiles Include="$(_NetHostOutputDir)nethost.h" />
       <NetHostFiles Include="$(_NetHostOutputDir)$(LibPrefix)nethost$(LibSuffix)" />
+      <NetHostFiles Include="$(_NetHostOutputDir)$(StaticLibPrefix)nethost$(StaticLibSuffix)" />
       <NetHostFiles Condition="'$(OSGroup)' == 'Windows_NT'" Include="$(_NetHostOutputDir)nethost.lib" />
     </ItemGroup>
     <Copy SourceFiles="@(NetHostFiles)"
index fe8c133..a6051c2 100644 (file)
@@ -3,6 +3,7 @@
   <ItemGroup>
     <ArchitectureSpecificNativeFile Include="$(DotNetHostBinDir)/apphost" />
     <ArchitectureSpecificNativeFile Include="$(DotNetHostBinDir)/libnethost.so" />
+    <ArchitectureSpecificNativeFile Include="$(DotNetHostBinDir)/libnethost.a" />
     <ArchitectureSpecificNativeFile Include="$(DotNetHostBinDir)/nethost.h" />
 
     <File Include="@(ArchitectureSpecificNativeFile)">
index ebf6fb9..cc38b3b 100644 (file)
@@ -3,6 +3,7 @@
   <ItemGroup>
     <ArchitectureSpecificNativeFile Include="$(DotNetHostBinDir)/apphost" />
     <ArchitectureSpecificNativeFile Include="$(DotNetHostBinDir)/libnethost.dylib" />
+    <ArchitectureSpecificNativeFile Include="$(DotNetHostBinDir)/libnethost.a" />
     <ArchitectureSpecificNativeFile Include="$(DotNetHostBinDir)/nethost.h" />
 
     <File Include="@(ArchitectureSpecificNativeFile)">
index fe8c133..a6051c2 100644 (file)
@@ -3,6 +3,7 @@
   <ItemGroup>
     <ArchitectureSpecificNativeFile Include="$(DotNetHostBinDir)/apphost" />
     <ArchitectureSpecificNativeFile Include="$(DotNetHostBinDir)/libnethost.so" />
+    <ArchitectureSpecificNativeFile Include="$(DotNetHostBinDir)/libnethost.a" />
     <ArchitectureSpecificNativeFile Include="$(DotNetHostBinDir)/nethost.h" />
 
     <File Include="@(ArchitectureSpecificNativeFile)">
index 9cc0b41..c74da91 100644 (file)
@@ -6,6 +6,7 @@
     <ArchitectureSpecificNativeFile Include="$(DotNetHostBinDir)/ijwhost.dll" />
     <ArchitectureSpecificNativeFile Include="$(DotNetHostBinDir)/ijwhost.lib" />
     <ArchitectureSpecificNativeFile Include="$(DotNetHostBinDir)/nethost.dll" />
+    <ArchitectureSpecificNativeFile Include="$(DotNetHostBinDir)/libnethost.lib" />
     <ArchitectureSpecificNativeFile Include="$(DotNetHostBinDir)/nethost.h" />
     <ArchitectureSpecificNativeFile Include="$(DotNetHostBinDir)/nethost.lib" />