-
Notifications
You must be signed in to change notification settings - Fork 7.7k
[nethost] Update nethost #25004
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
[nethost] Update nethost #25004
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9242f41
update nethost
lanyizi 16f8683
bump nethost version
lanyizi 8082b31
Add CMake exports in an unofficial- namespace
lanyizi 8984bc1
fix port version and deprecated functions
lanyizi 62d20f9
change nethost version date to version
lanyizi 4ad2278
update usage
lanyizi bc3f614
add quotes to paths and export targets directly
lanyizi 9c64735
bump nethost version
lanyizi 45fe29b
[nethost] Only build one flavor
ras0219-msft 8a57237
fix build error
lanyizi b100919
bump nethost version
lanyizi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,58 +1,73 @@ | ||
| diff --git a/src/installer/corehost/cli/common.cmake b/src/installer/corehost/cli/common.cmake | ||
| index 63e7306..639c90e 100644 | ||
| --- a/src/installer/corehost/cli/common.cmake | ||
| +++ b/src/installer/corehost/cli/common.cmake | ||
| @@ -5,9 +5,6 @@ | ||
| project(${DOTNET_PROJECT_NAME}) | ||
|
|
||
| if(WIN32) | ||
| - add_compile_options($<$<CONFIG:RelWithDebInfo>:/MT>) | ||
| - add_compile_options($<$<CONFIG:Release>:/MT>) | ||
| - add_compile_options($<$<CONFIG:Debug>:/MTd>) | ||
| else() | ||
| add_compile_options(-fvisibility=hidden) | ||
| endif() | ||
| diff --git a/src/installer/corehost/cli/nethost/CMakeLists.txt b/src/installer/corehost/cli/nethost/CMakeLists.txt | ||
| index 7473958..49c664f 100644 | ||
| --- a/src/installer/corehost/cli/nethost/CMakeLists.txt | ||
| +++ b/src/installer/corehost/cli/nethost/CMakeLists.txt | ||
| @@ -2,12 +2,14 @@ | ||
| diff --git a/src/native/corehost/nethost/CMakeLists.txt b/src/native/corehost/nethost/CMakeLists.txt | ||
| index a9f44e720..0f24d4458 100644 | ||
| --- a/src/native/corehost/nethost/CMakeLists.txt | ||
| +++ b/src/native/corehost/nethost/CMakeLists.txt | ||
| @@ -1,11 +1,14 @@ | ||
| # 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. | ||
|
|
||
| -cmake_minimum_required (VERSION 2.6) | ||
| +cmake_minimum_required (VERSION 3.14) | ||
| +cmake_minimum_required (VERSION 3.14.5) | ||
| project(nethost) | ||
|
|
||
| set(DOTNET_PROJECT_NAME "nethost") | ||
|
|
||
| # Include directories | ||
| +include(../../../settings.cmake) | ||
| +include(../../../functions.cmake) | ||
| +include(../../../../eng/native/configurepaths.cmake) | ||
| +include("${CLR_ENG_NATIVE_DIR}/configurecompiler.cmake") | ||
| include_directories(../fxr) | ||
|
|
||
| # CMake does not recommend using globbing since it messes with the freshness checks | ||
| @@ -22,13 +24,18 @@ if(WIN32) | ||
| @@ -19,12 +22,23 @@ if(CLR_CMAKE_TARGET_WIN32) | ||
| Exports.def) | ||
| endif() | ||
|
|
||
| +if(BUILD_SHARED_LIBS) | ||
| include(../lib.cmake) | ||
| +set(targets nethost) | ||
| +else() | ||
| +include(../hostmisc/hostmisc.cmake) | ||
| include(../lib_static.cmake) | ||
| +add_library(nethost INTERFACE) | ||
| +target_link_libraries(nethost INTERFACE libnethost) | ||
| +set(targets libnethost nethost) | ||
| +target_include_directories(libnethost INTERFACE $<INSTALL_INTERFACE:include>) | ||
| +endif() | ||
| +target_include_directories(nethost INTERFACE $<INSTALL_INTERFACE:include>) | ||
|
|
||
| add_definitions(-DFEATURE_LIBHOST=1) | ||
| add_definitions(-DNETHOST_EXPORT) | ||
|
|
||
| +if(NOT BUILD_SHARED_LIBS) | ||
| # Copy static lib PDB to the project output directory | ||
| if (WIN32) | ||
| set_target_properties(libnethost PROPERTIES | ||
| @@ -32,15 +46,18 @@ if (WIN32) | ||
| COMPILE_PDB_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}" | ||
| ) | ||
| endif(WIN32) | ||
| +endif() | ||
|
|
||
| -install(FILES ../coreclr_delegates.h DESTINATION corehost) | ||
| -install(FILES ../hostfxr.h DESTINATION corehost) | ||
| -install(FILES nethost.h DESTINATION corehost) | ||
| -install(TARGETS nethost DESTINATION corehost) | ||
| -install(TARGETS libnethost DESTINATION corehost) | ||
| -install_symbols(nethost corehost) | ||
| -install_with_stripped_symbols(nethost TARGETS corehost) | ||
| +set(NETHOST_HEADERS nethost.h ../coreclr_delegates.h ../hostfxr.h) | ||
| +install(FILES ${NETHOST_HEADERS} DESTINATION include) | ||
| +install(TARGETS ${targets} EXPORT unofficial-nethost-config | ||
| + ARCHIVE DESTINATION lib | ||
| + LIBRARY DESTINATION lib | ||
| + RUNTIME DESTINATION bin | ||
| +) | ||
|
|
||
| -# 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) | ||
| \ No newline at end of file | ||
| +install(FILES nethost.h ../coreclr_delegates.h ../hostfxr.h DESTINATION include) | ||
| +if(BUILD_SHARED_LIBS) | ||
| +install(TARGETS nethost) | ||
| +else() | ||
| +install(TARGETS libnethost) | ||
| +endif() | ||
| +install(EXPORT unofficial-nethost-config | ||
| + DESTINATION share/unofficial-nethost | ||
| + FILE unofficial-nethost-config.cmake | ||
| + NAMESPACE unofficial::nethost:: | ||
| +) |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,4 @@ | ||
| The package nethost can be used via CMake: | ||
|
|
||
| find_path(NETHOST_INCLUDE_DIRS nethost.h) | ||
| find_library(NETHOST_LIBRARY NAMES libnethost nethost) | ||
| target_include_directories(main PRIVATE ${NETHOST_INCLUDE_DIRS}) | ||
| target_link_libraries(main PRIVATE ${NETHOST_LIBRARY}) | ||
| find_package(unofficial-nethost CONFIG REQUIRED) | ||
| target_link_libraries(main PRIVATE unofficial::nethost::nethost) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,17 @@ | ||
| { | ||
| "name": "nethost", | ||
| "version-date": "2019-12-21", | ||
| "port-version": 2, | ||
| "version": "6.0.5", | ||
| "description": "Provides a set of APIs that can be used to host .NET Core (dotnet)", | ||
| "homepage": "https://github.com/dotnet/runtime/tree/master/src/installer/corehost/cli/nethost", | ||
| "supports": "!uwp" | ||
| "supports": "!uwp", | ||
| "dependencies": [ | ||
| { | ||
| "name": "vcpkg-cmake", | ||
| "host": true | ||
| }, | ||
| { | ||
| "name": "vcpkg-cmake-config", | ||
| "host": true | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.