未验证 提交 5d04c9e9 编写于 作者: A Adeel Mujahid 提交者: GitHub

Move corehost under src/native (#48071)

* Move corehost under src/native

* Move content out of cli/ directory

* Update configurations post-move

* Update docs
上级 74a6c76e
......@@ -55,6 +55,7 @@
<CoreClrProjectRoot>$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', 'src', 'coreclr'))</CoreClrProjectRoot>
<MonoProjectRoot>$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', 'src', 'mono'))</MonoProjectRoot>
<InstallerProjectRoot>$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', 'src', 'installer'))</InstallerProjectRoot>
<SharedNativeRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'native'))</SharedNativeRoot>
<RepoToolsLocalDir>$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', 'tools-local'))</RepoToolsLocalDir>
<RepoTasksDir>$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', 'src', 'tasks'))</RepoTasksDir>
<IbcOptimizationDataDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'ibc'))</IbcOptimizationDataDir>
......
......@@ -11,7 +11,7 @@ Each framework reference consists of these values
* Version - for example `3.0.1`
* Roll-forward setting - for example `Minor`
*In the code the framework reference is represented by an instance of [`fx_reference_t`](https://github.com/dotnet/runtime/blob/master/src/installer/corehost/cli/fx_reference.h).*
*In the code the framework reference is represented by an instance of [`fx_reference_t`](https://github.com/dotnet/runtime/blob/master/src/native/corehost/fx_reference.h).*
In the `.runtimeconfig.json` these values are defined like this:
``` json
......
......@@ -488,8 +488,8 @@ One such scenario is a COM host on multiple threads. The app is not running any
At the same time it gives the native app (`comhost` in this case) the ability to query and modify runtime properties in between the `hostfxr_initialize...` and `hostfxr_get_runtime_delegate` calls on the `first host context`.
### API usage
The `hostfxr` exports are defined in the [hostfxr.h](https://github.com/dotnet/runtime/blob/master/src/installer/corehost/cli/hostfxr.h) header file.
The runtime helper and method signatures for loading managed components are defined in [coreclr_delegates.h](https://github.com/dotnet/runtime/blob/master/src/installer/corehost/cli/coreclr_delegates.h) header file.
The `hostfxr` exports are defined in the [hostfxr.h](https://github.com/dotnet/runtime/blob/master/src/native/corehost/hostfxr.h) header file.
The runtime helper and method signatures for loading managed components are defined in [coreclr_delegates.h](https://github.com/dotnet/runtime/blob/master/src/native/corehost/coreclr_delegates.h) header file.
Currently we don't plan to ship these files, but it's possible to take them from the repo and use it.
......
......@@ -256,7 +256,7 @@
<!-- Host sets -->
<ItemGroup Condition="$(_subset.Contains('+host.native+'))">
<CorehostProjectToBuild Include="$(InstallerProjectRoot)corehost\corehost.proj" SignPhase="Binaries" BuildInParallel="false" />
<CorehostProjectToBuild Include="$(InstallerProjectRoot)corehost.proj" SignPhase="Binaries" BuildInParallel="false" />
<ProjectToBuild Include="@(CorehostProjectToBuild)" Pack="true" Category="host" />
</ItemGroup>
......
......@@ -45,8 +45,8 @@
Use IgnoreStandardErrorWarningFormat because Arcade sets WarnAsError and there's an existing
warning in the macOS build when dsymutil tries to strip symbols.
-->
<Message Text="$(MSBuildProjectDirectory)\build.sh $(BuildArgs)" Importance="High"/>
<Exec Command="$(MSBuildProjectDirectory)\build.sh $(BuildArgs)" IgnoreStandardErrorWarningFormat="true"/>
<Message Text="$(SharedNativeRoot)\corehost\build.sh $(BuildArgs)" Importance="High"/>
<Exec Command="$(SharedNativeRoot)\corehost\build.sh $(BuildArgs)" IgnoreStandardErrorWarningFormat="true"/>
</Target>
<Target Name="BuildCoreHostWindows"
......@@ -103,8 +103,8 @@
IgnoreStandardErrorWarningFormat because Arcade sets WarnAsError and there's an existing
warning in the native build.
-->
<Message Text="$(MSBuildProjectDirectory)\build.cmd $(BuildArgs)" Importance="High"/>
<Exec Command="$(MSBuildProjectDirectory)\build.cmd $(BuildArgs)" IgnoreStandardErrorWarningFormat="true"/>
<Message Text="$(SharedNativeRoot)\corehost\build.cmd $(BuildArgs)" Importance="High"/>
<Exec Command="$(SharedNativeRoot)\corehost\build.cmd $(BuildArgs)" IgnoreStandardErrorWarningFormat="true"/>
</Target>
<Target Name="PrependWindowsHeaderIncludeToVersionHeaderFile"
......
if(RUNTIME_FLAVOR STREQUAL "Mono")
add_subdirectory(hostcommon)
add_subdirectory(fxr)
add_subdirectory(hostpolicy)
else()
add_subdirectory(hostcommon)
add_subdirectory(apphost)
add_subdirectory(dotnet)
add_subdirectory(nethost)
add_subdirectory(test_fx_ver)
add_subdirectory(fxr)
add_subdirectory(hostpolicy)
add_subdirectory(test)
if(CLR_CMAKE_TARGET_WIN32)
add_subdirectory(comhost)
add_subdirectory(ijwhost)
endif()
endif()
\ No newline at end of file
cmake_minimum_required(VERSION 3.6.2)
if (CMAKE_VERSION VERSION_GREATER 3.15 OR CMAKE_VERSION VERSION_EQUAL 3.15)
cmake_policy(SET CMP0091 NEW)
cmake_policy(SET CMP0091 NEW)
endif()
project(corehost)
......@@ -9,7 +9,7 @@ project(corehost)
include(../../../eng/native/configurepaths.cmake)
include(${CLR_ENG_NATIVE_DIR}/configurecompiler.cmake)
if(MSVC)
if (MSVC)
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/wd4996>)
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/wd4267>)
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/wd4018>)
......@@ -23,4 +23,19 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES GNU)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fno-use-cxa-atexit>)
endif()
add_subdirectory(cli)
add_subdirectory(hostcommon)
add_subdirectory(fxr)
add_subdirectory(hostpolicy)
if (NOT RUNTIME_FLAVOR STREQUAL Mono)
add_subdirectory(apphost)
add_subdirectory(dotnet)
add_subdirectory(nethost)
add_subdirectory(test_fx_ver)
add_subdirectory(test)
if(CLR_CMAKE_TARGET_WIN32)
add_subdirectory(comhost)
add_subdirectory(ijwhost)
endif()
endif()
......@@ -25,7 +25,7 @@ set(SOURCES
set(HEADERS
../bundle_marker.h
../../../hostfxr_resolver.h
../../hostfxr_resolver.h
)
if(CLR_CMAKE_TARGET_WIN32)
......
......@@ -28,7 +28,7 @@ set(SOURCES
set(HEADERS
../bundle_marker.h
../../../hostfxr_resolver.h
../../hostfxr_resolver.h
)
add_definitions(-D_NO_ASYNCRTIMP)
......
......@@ -14,7 +14,7 @@
#include "bundle_marker.h"
#if defined(_WIN32)
#include "cli/apphost/apphost.windows.h"
#include "apphost/apphost.windows.h"
#endif
#define CURHOST_TYPE _X("apphost")
......
......@@ -14,10 +14,10 @@ include_directories(${CMAKE_CURRENT_LIST_DIR}/fxr)
# CMake does not recommend using globbing since it messes with the freshness checks
list(APPEND SOURCES
${CMAKE_CURRENT_LIST_DIR}/fxr_resolver.cpp
${CMAKE_CURRENT_LIST_DIR}/../corehost.cpp
${CMAKE_CURRENT_LIST_DIR}/corehost.cpp
)
list(APPEND HEADERS
${CMAKE_CURRENT_LIST_DIR}/../hostfxr_resolver.h
${CMAKE_CURRENT_LIST_DIR}/hostfxr_resolver.h
)
add_executable(${DOTNET_PROJECT_NAME} ${SOURCES} ${RESOURCES})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册