early-access version 2853
This commit is contained in:
73
externals/vcpkg/ports/nethost/0001-nethost-cmakelists.patch
vendored
Executable file
73
externals/vcpkg/ports/nethost/0001-nethost-cmakelists.patch
vendored
Executable file
@@ -0,0 +1,73 @@
|
||||
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.
|
||||
|
||||
+cmake_minimum_required (VERSION 3.14.5)
|
||||
project(nethost)
|
||||
|
||||
set(DOTNET_PROJECT_NAME "nethost")
|
||||
|
||||
# Include directories
|
||||
+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
|
||||
@@ -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_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(EXPORT unofficial-nethost-config
|
||||
+ DESTINATION share/unofficial-nethost
|
||||
+ FILE unofficial-nethost-config.cmake
|
||||
+ NAMESPACE unofficial::nethost::
|
||||
+)
|
||||
77
externals/vcpkg/ports/nethost/portfile.cmake
vendored
Executable file
77
externals/vcpkg/ports/nethost/portfile.cmake
vendored
Executable file
@@ -0,0 +1,77 @@
|
||||
set(COMMIT_HASH v6.0.5)
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO dotnet/runtime
|
||||
REF ${COMMIT_HASH}
|
||||
SHA512 ccf4865bd9ea63c525fc11b0008774052d51f9247427fc28a91e3836e8e8d157569565bdac17326fe44a446d98a3e4b74a55779d01bede596f2458f4ec86f3aa
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
0001-nethost-cmakelists.patch
|
||||
)
|
||||
|
||||
set(PRODUCT_VERSION "6.0.5")
|
||||
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
set(RID_PLAT "win")
|
||||
elseif(VCPKG_TARGET_IS_OSX)
|
||||
set(RID_PLAT "osx")
|
||||
elseif(VCPKG_TARGET_IS_LINUX)
|
||||
set(RID_PLAT "linux")
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported platform")
|
||||
endif()
|
||||
|
||||
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
|
||||
set(RID_ARCH "x86")
|
||||
set(ARCH_NAME "I386")
|
||||
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
|
||||
set(RID_ARCH "x64")
|
||||
set(ARCH_NAME "AMD64")
|
||||
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
|
||||
set(RID_ARCH "arm")
|
||||
set(ARCH_NAME "ARM")
|
||||
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
|
||||
set(RID_ARCH "arm64")
|
||||
set(ARCH_NAME "ARM64")
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported architecture")
|
||||
endif()
|
||||
|
||||
set(BASE_RID "${RID_PLAT}-${RID_ARCH}")
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}/src/native/corehost/nethost/"
|
||||
# vcpkg's /utf-8 is incompatible with dotnet's own /source-charset:utf-8
|
||||
NO_CHARSET_FLAG
|
||||
OPTIONS
|
||||
"-DSKIP_VERSIONING=1"
|
||||
"-DCLI_CMAKE_HOST_POLICY_VER:STRING=${PRODUCT_VERSION}"
|
||||
"-DCLI_CMAKE_HOST_FXR_VER:STRING=${PRODUCT_VERSION}"
|
||||
"-DCLI_CMAKE_HOST_VER:STRING=${PRODUCT_VERSION}"
|
||||
"-DCLI_CMAKE_COMMON_HOST_VER:STRING=${PRODUCT_VERSION}"
|
||||
"-DCLI_CMAKE_PKG_RID:STRING=${BASE_RID}"
|
||||
"-DCLI_CMAKE_COMMIT_HASH:STRING=${COMMIT_HASH}"
|
||||
"-DCLR_CMAKE_TARGET_ARCH_${ARCH_NAME}=1"
|
||||
"-DCLR_CMAKE_TARGET_ARCH=${RID_ARCH}"
|
||||
"-DCLR_CMAKE_HOST_ARCH=${RID_ARCH}"
|
||||
MAYBE_UNUSED_VARIABLES
|
||||
SKIP_VERSIONING # only used on WIN32
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-nethost)
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/nethost.h" "#ifdef NETHOST_USE_AS_STATIC" "#if 1")
|
||||
else()
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/nethost.h" "#ifdef NETHOST_USE_AS_STATIC" "#if 0")
|
||||
endif()
|
||||
|
||||
file(INSTALL "${SOURCE_PATH}/LICENSE.TXT" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
4
externals/vcpkg/ports/nethost/usage
vendored
Executable file
4
externals/vcpkg/ports/nethost/usage
vendored
Executable file
@@ -0,0 +1,4 @@
|
||||
The package nethost can be used via CMake:
|
||||
|
||||
find_package(unofficial-nethost CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE unofficial::nethost::nethost)
|
||||
17
externals/vcpkg/ports/nethost/vcpkg.json
vendored
Executable file
17
externals/vcpkg/ports/nethost/vcpkg.json
vendored
Executable file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "nethost",
|
||||
"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",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user