From b70f093ad6700d37d12962fb58b7e69694636136 Mon Sep 17 00:00:00 2001 From: NextTurn <45985406+NextTurn@users.noreply.github.com> Date: Sat, 5 Jan 2019 00:00:00 +0800 Subject: [PATCH 1/2] Proposal: Publish nethost static library --- src/Directory.Build.props | 2 ++ src/corehost/cli/libs.cmake | 17 +++++++++++++++++ src/corehost/cli/nethost/CMakeLists.txt | 2 ++ src/pkg/packaging/installers.proj | 1 + ...reeBSD.Microsoft.NETCore.DotNetAppHost.props | 1 + ...me.OSX.Microsoft.NETCore.DotNetAppHost.props | 1 + ...e.Unix.Microsoft.NETCore.DotNetAppHost.props | 1 + ...ows_NT.Microsoft.NETCore.DotNetAppHost.props | 1 + 8 files changed, 26 insertions(+) create mode 100644 src/corehost/cli/libs.cmake diff --git a/src/Directory.Build.props b/src/Directory.Build.props index c22e11faca..899311b683 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -6,6 +6,8 @@ .so .dll .dylib + s.a + s.lib diff --git a/src/corehost/cli/libs.cmake b/src/corehost/cli/libs.cmake new file mode 100644 index 0000000000..d40cea0bf6 --- /dev/null +++ b/src/corehost/cli/libs.cmake @@ -0,0 +1,17 @@ +# 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(${DOTNET_PROJECT_NAME}s) + +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(${DOTNET_PROJECT_NAME}s STATIC ${SOURCES} ${RESOURCES}) + +set_target_properties(${DOTNET_PROJECT_NAME}s PROPERTIES MACOSX_RPATH TRUE) + +set_common_libs("lib") diff --git a/src/corehost/cli/nethost/CMakeLists.txt b/src/corehost/cli/nethost/CMakeLists.txt index b56650bfac..115e3af166 100644 --- a/src/corehost/cli/nethost/CMakeLists.txt +++ b/src/corehost/cli/nethost/CMakeLists.txt @@ -23,10 +23,12 @@ if(WIN32) endif() include(../lib.cmake) +include(../libs.cmake) add_definitions(-DFEATURE_LIBHOST=1) add_definitions(-DNETHOST_EXPORT) install(FILES nethost.h DESTINATION corehost) install(TARGETS nethost DESTINATION corehost) +install(TARGETS nethosts DESTINATION corehost) install_symbols(nethost corehost) \ No newline at end of file diff --git a/src/pkg/packaging/installers.proj b/src/pkg/packaging/installers.proj index e2a60d4ec7..f4c24d41fd 100644 --- a/src/pkg/packaging/installers.proj +++ b/src/pkg/packaging/installers.proj @@ -121,6 +121,7 @@ + + diff --git a/src/pkg/projects/Microsoft.NETCore.DotNetAppHost/runtime.OSX.Microsoft.NETCore.DotNetAppHost.props b/src/pkg/projects/Microsoft.NETCore.DotNetAppHost/runtime.OSX.Microsoft.NETCore.DotNetAppHost.props index ebf6fb947c..14352c8a01 100644 --- a/src/pkg/projects/Microsoft.NETCore.DotNetAppHost/runtime.OSX.Microsoft.NETCore.DotNetAppHost.props +++ b/src/pkg/projects/Microsoft.NETCore.DotNetAppHost/runtime.OSX.Microsoft.NETCore.DotNetAppHost.props @@ -3,6 +3,7 @@ + diff --git a/src/pkg/projects/Microsoft.NETCore.DotNetAppHost/runtime.Unix.Microsoft.NETCore.DotNetAppHost.props b/src/pkg/projects/Microsoft.NETCore.DotNetAppHost/runtime.Unix.Microsoft.NETCore.DotNetAppHost.props index fe8c133798..08d1284425 100644 --- a/src/pkg/projects/Microsoft.NETCore.DotNetAppHost/runtime.Unix.Microsoft.NETCore.DotNetAppHost.props +++ b/src/pkg/projects/Microsoft.NETCore.DotNetAppHost/runtime.Unix.Microsoft.NETCore.DotNetAppHost.props @@ -3,6 +3,7 @@ + diff --git a/src/pkg/projects/Microsoft.NETCore.DotNetAppHost/runtime.Windows_NT.Microsoft.NETCore.DotNetAppHost.props b/src/pkg/projects/Microsoft.NETCore.DotNetAppHost/runtime.Windows_NT.Microsoft.NETCore.DotNetAppHost.props index 9cc0b41e63..de42701cf8 100644 --- a/src/pkg/projects/Microsoft.NETCore.DotNetAppHost/runtime.Windows_NT.Microsoft.NETCore.DotNetAppHost.props +++ b/src/pkg/projects/Microsoft.NETCore.DotNetAppHost/runtime.Windows_NT.Microsoft.NETCore.DotNetAppHost.props @@ -6,6 +6,7 @@ + From de13ca8c8a3478ae4b145c3d8ed267515920f533 Mon Sep 17 00:00:00 2001 From: NextTurn <45985406+NextTurn@users.noreply.github.com> Date: Wed, 2 Jan 2019 00:00:00 +0800 Subject: [PATCH 2/2] Use lib prefix --- src/Directory.Build.props | 5 +++-- src/corehost/cli/{libs.cmake => lib_static.cmake} | 7 ++++--- src/corehost/cli/nethost/CMakeLists.txt | 4 ++-- src/pkg/packaging/installers.proj | 2 +- .../runtime.FreeBSD.Microsoft.NETCore.DotNetAppHost.props | 2 +- .../runtime.OSX.Microsoft.NETCore.DotNetAppHost.props | 2 +- .../runtime.Unix.Microsoft.NETCore.DotNetAppHost.props | 2 +- ...untime.Windows_NT.Microsoft.NETCore.DotNetAppHost.props | 2 +- 8 files changed, 14 insertions(+), 12 deletions(-) rename src/corehost/cli/{libs.cmake => lib_static.cmake} (60%) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 899311b683..b423b589a9 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -6,8 +6,9 @@ .so .dll .dylib - s.a - s.lib + lib + .a + .lib diff --git a/src/corehost/cli/libs.cmake b/src/corehost/cli/lib_static.cmake similarity index 60% rename from src/corehost/cli/libs.cmake rename to src/corehost/cli/lib_static.cmake index d40cea0bf6..6c4b5036cf 100644 --- a/src/corehost/cli/libs.cmake +++ b/src/corehost/cli/lib_static.cmake @@ -2,7 +2,7 @@ # The .NET Foundation licenses this file to you under the MIT license. # See the LICENSE file in the project root for more information. -project(${DOTNET_PROJECT_NAME}s) +project(lib${DOTNET_PROJECT_NAME}) include(${CMAKE_CURRENT_LIST_DIR}/common.cmake) @@ -10,8 +10,9 @@ add_definitions(-D_NO_ASYNCRTIMP) add_definitions(-D_NO_PPLXIMP) add_definitions(-DEXPORT_SHARED_API=1) -add_library(${DOTNET_PROJECT_NAME}s STATIC ${SOURCES} ${RESOURCES}) +add_library(lib${DOTNET_PROJECT_NAME} STATIC ${SOURCES} ${RESOURCES}) -set_target_properties(${DOTNET_PROJECT_NAME}s PROPERTIES MACOSX_RPATH TRUE) +set_target_properties(lib${DOTNET_PROJECT_NAME} PROPERTIES MACOSX_RPATH TRUE) +set_target_properties(lib${DOTNET_PROJECT_NAME} PROPERTIES PREFIX "") set_common_libs("lib") diff --git a/src/corehost/cli/nethost/CMakeLists.txt b/src/corehost/cli/nethost/CMakeLists.txt index 115e3af166..7473958e26 100644 --- a/src/corehost/cli/nethost/CMakeLists.txt +++ b/src/corehost/cli/nethost/CMakeLists.txt @@ -23,12 +23,12 @@ if(WIN32) endif() include(../lib.cmake) -include(../libs.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 nethosts DESTINATION corehost) +install(TARGETS libnethost DESTINATION corehost) install_symbols(nethost corehost) \ No newline at end of file diff --git a/src/pkg/packaging/installers.proj b/src/pkg/packaging/installers.proj index f4c24d41fd..d9448e3afc 100644 --- a/src/pkg/packaging/installers.proj +++ b/src/pkg/packaging/installers.proj @@ -121,7 +121,7 @@ - + - + diff --git a/src/pkg/projects/Microsoft.NETCore.DotNetAppHost/runtime.OSX.Microsoft.NETCore.DotNetAppHost.props b/src/pkg/projects/Microsoft.NETCore.DotNetAppHost/runtime.OSX.Microsoft.NETCore.DotNetAppHost.props index 14352c8a01..cc38b3b848 100644 --- a/src/pkg/projects/Microsoft.NETCore.DotNetAppHost/runtime.OSX.Microsoft.NETCore.DotNetAppHost.props +++ b/src/pkg/projects/Microsoft.NETCore.DotNetAppHost/runtime.OSX.Microsoft.NETCore.DotNetAppHost.props @@ -3,7 +3,7 @@ - + diff --git a/src/pkg/projects/Microsoft.NETCore.DotNetAppHost/runtime.Unix.Microsoft.NETCore.DotNetAppHost.props b/src/pkg/projects/Microsoft.NETCore.DotNetAppHost/runtime.Unix.Microsoft.NETCore.DotNetAppHost.props index 08d1284425..a6051c2df1 100644 --- a/src/pkg/projects/Microsoft.NETCore.DotNetAppHost/runtime.Unix.Microsoft.NETCore.DotNetAppHost.props +++ b/src/pkg/projects/Microsoft.NETCore.DotNetAppHost/runtime.Unix.Microsoft.NETCore.DotNetAppHost.props @@ -3,7 +3,7 @@ - + diff --git a/src/pkg/projects/Microsoft.NETCore.DotNetAppHost/runtime.Windows_NT.Microsoft.NETCore.DotNetAppHost.props b/src/pkg/projects/Microsoft.NETCore.DotNetAppHost/runtime.Windows_NT.Microsoft.NETCore.DotNetAppHost.props index de42701cf8..c74da91a0f 100644 --- a/src/pkg/projects/Microsoft.NETCore.DotNetAppHost/runtime.Windows_NT.Microsoft.NETCore.DotNetAppHost.props +++ b/src/pkg/projects/Microsoft.NETCore.DotNetAppHost/runtime.Windows_NT.Microsoft.NETCore.DotNetAppHost.props @@ -6,7 +6,7 @@ - +