Skip to content

Commit

Permalink
Change location of some source files (dotnet#1376)
Browse files Browse the repository at this point in the history
* Move coreclr/src/coreclr/hosts to one level up

* Move native commons to :/eng/native
  • Loading branch information
am11 authored and safern committed Jan 8, 2020
1 parent 9de4006 commit f1dd1d3
Show file tree
Hide file tree
Showing 43 changed files with 22 additions and 25 deletions.
6 changes: 3 additions & 3 deletions docs/design/features/native-hosting.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ App (native or .NET Core both) which needs to use some of the other services pro

## Existing support
* **C-style ABI in `coreclr`**
`coreclr` exposes ABI to host the .NET Core runtime and run managed code already using C-style APIs. See this [header file](https://github.com/dotnet/coreclr/blob/master/src/coreclr/hosts/inc/coreclrhost.h) for the exposed functions.
`coreclr` exposes ABI to host the .NET Core runtime and run managed code already using C-style APIs. See this [header file](https://github.com/dotnet/runtime/blob/master/src/coreclr/src/hosts/inc/coreclrhost.h) for the exposed functions.
This API requires the native host to locate the runtime and to fully specify all startup parameters for the runtime. There's no inherent interoperability between these APIs and the .NET Core SDK.
* **COM-style ABI in `coreclr`**
`coreclr` exposes COM-style ABI to host the .NET Core runtime and perform a wide range of operations on it. See this [header file](https://github.com/dotnet/coreclr/blob/master/src/pal/prebuilt/inc/mscoree.h) for more details.
`coreclr` exposes COM-style ABI to host the .NET Core runtime and perform a wide range of operations on it. See this [header file](https://github.com/dotnet/runtime/blob/master/src/coreclr/src/pal/prebuilt/inc/mscoree.h) for more details.
Similarly to the C-style ABI the COM-style ABI also requires the native host to locate the runtime and to fully specify all startup parameters.
There's no inherent interoperability between these APIs and the .NET Core SDK.
The COM-style ABI is deprecated and should not be used going forward.
Expand Down Expand Up @@ -377,7 +377,7 @@ At the same time it gives the native app (`comhost` in this case) the ability to
### API usage
The `hostfxr` exports are defined in the [hostfxr.h](https://github.com/dotnet/core-setup/blob/master/src/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/core-setup/blob/master/src/corehost/cli/coreclr_delegates.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.
Currently we don't plan to ship these files, but it's possible to take them from the repo and use it.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ if [ "$CROSSCOMPILE" == "1" ]; then
fi
export TARGET_BUILD_ARCH=$build_arch
cmake_extra_defines="$cmake_extra_defines -C $tryrun_dir/tryrun.cmake"
cmake_extra_defines="$cmake_extra_defines -DCMAKE_TOOLCHAIN_FILE=$scriptroot/toolchain.cmake"
cmake_extra_defines="$cmake_extra_defines -DCMAKE_TOOLCHAIN_FILE=$scriptroot/../common/cross/toolchain.cmake"
fi

cmake_command=$(command -v cmake)
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ endif(WIN32)
# Configure compiler settings for environment
#----------------------------------------------------
include(configurecompiler.cmake)
include(${CLR_COMMON_DIR}/configuretools.cmake)
include(${CLR_ENG_NATIVE_DIR}/configuretools.cmake)

#----------------------------------------------------
# Cross target Component build specific configuration
Expand All @@ -136,7 +136,7 @@ include(pgosupport.cmake)
#-----------------------------------------
if(CLR_CMAKE_PLATFORM_UNIX)
add_subdirectory(src/pal)
add_subdirectory(src/coreclr/hosts)
add_subdirectory(src/hosts)
endif(CLR_CMAKE_PLATFORM_UNIX)

# Add this subdir. We install the headers for the jit.
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/build-test.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ if not defined VSINSTALLDIR (
)
if not exist "%VSINSTALLDIR%DIA SDK" goto NoDIA

set __ExtraCmakeArgs="-DCMAKE_SYSTEM_VERSION=10.0" "-DCLR_COMMON_DIR=%__RepoRootDir%/eng/common"
set __ExtraCmakeArgs="-DCMAKE_SYSTEM_VERSION=10.0" "-DCLR_ENG_NATIVE_DIR=%__RepoRootDir%/eng/native"
call "%__SourceDir%\pal\tools\gen-buildsys.cmd" "%__ProjectFilesDir%" "%__NativeTestIntermediatesDir%" %__VSVersion% %__BuildArch% !__ExtraCmakeArgs!

if not !errorlevel! == 0 (
Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/build-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -509,9 +509,9 @@ build_native_projects()
extraCmakeArguments="$extraCmakeArguments -DCLR_CMAKE_ENABLE_CODE_COVERAGE=1"
fi

commonDir="$__RepoRootDir/eng/common"
__cmakeargs="$__cmakeargs -DCLR_COMMON_DIR=\"$commonDir\""
nextCommand="\"$commonDir/cross/gen-buildsys.sh\" \"$__TestDir\" \"$__ProjectRoot\" \"$intermediatesForBuild\" $platformArch $__Compiler \"$__CompilerMajorVersion\" \"$__CompilerMinorVersion\" $__BuildType $generator $extraCmakeArguments $__cmakeargs"
engNativeDir="$__RepoRootDir/eng/native"
__cmakeargs="$__cmakeargs -DCLR_ENG_NATIVE_DIR=\"$engNativeDir\""
nextCommand="\"$engNativeDir/gen-buildsys.sh\" \"$__TestDir\" \"$__ProjectRoot\" \"$intermediatesForBuild\" $platformArch $__Compiler \"$__CompilerMajorVersion\" \"$__CompilerMinorVersion\" $__BuildType $generator $extraCmakeArguments $__cmakeargs"
echo "Invoking $nextCommand"
eval $nextCommand

Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ if %__BuildCrossArchNative% EQU 1 (

set __CMakeBinDir=%__CrossComponentBinDir%
set "__CMakeBinDir=!__CMakeBinDir:\=/!"
set __ExtraCmakeArgs="-DCLR_CROSS_COMPONENTS_BUILD=1" "-DCLR_CMAKE_TARGET_ARCH=%__BuildArch%" "-DCLR_CMAKE_PGO_INSTRUMENT=%__PgoInstrument%" "-DCLR_CMAKE_OPTDATA_PATH=%__PgoOptDataPath%" "-DCLR_CMAKE_PGO_OPTIMIZE=%__PgoOptimize%" "-DCMAKE_SYSTEM_VERSION=10.0" "-DCLR_COMMON_DIR=%__RepoRootDir%/eng/common"
set __ExtraCmakeArgs="-DCLR_CROSS_COMPONENTS_BUILD=1" "-DCLR_CMAKE_TARGET_ARCH=%__BuildArch%" "-DCLR_CMAKE_PGO_INSTRUMENT=%__PgoInstrument%" "-DCLR_CMAKE_OPTDATA_PATH=%__PgoOptDataPath%" "-DCLR_CMAKE_PGO_OPTIMIZE=%__PgoOptimize%" "-DCMAKE_SYSTEM_VERSION=10.0" "-DCLR_ENG_NATIVE_DIR=%__RepoRootDir%/eng/native"
call "%__SourceDir%\pal\tools\gen-buildsys.cmd" "%__ProjectDir%" "%__CrossCompIntermediatesDir%" %__VSVersion% %__CrossArch% !__ExtraCmakeArgs!

if not !errorlevel! == 0 (
Expand Down Expand Up @@ -562,7 +562,7 @@ if %__BuildNative% EQU 1 (

echo %__MsgPrefix%Regenerating the Visual Studio solution

set __ExtraCmakeArgs="-DCMAKE_SYSTEM_VERSION=10.0" !___CrossBuildDefine! "-DCLR_CMAKE_PGO_INSTRUMENT=%__PgoInstrument%" "-DCLR_CMAKE_OPTDATA_PATH=%__PgoOptDataPath%" "-DCLR_CMAKE_PGO_OPTIMIZE=%__PgoOptimize%" "-DCLR_COMMON_DIR=%__RepoRootDir%/eng/common"
set __ExtraCmakeArgs="-DCMAKE_SYSTEM_VERSION=10.0" !___CrossBuildDefine! "-DCLR_CMAKE_PGO_INSTRUMENT=%__PgoInstrument%" "-DCLR_CMAKE_OPTDATA_PATH=%__PgoOptDataPath%" "-DCLR_CMAKE_PGO_OPTIMIZE=%__PgoOptimize%" "-DCLR_ENG_NATIVE_DIR=%__RepoRootDir%/eng/native"
call "%__SourceDir%\pal\tools\gen-buildsys.cmd" "%__ProjectDir%" "%__IntermediatesDir%" %__VSVersion% %__BuildArch% !__ExtraCmakeArgs!
if not !errorlevel! == 0 (
echo %__ErrMsgPrefix%%__MsgPrefix%Error: failed to generate native component build project!
Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ build_native()
extraCmakeArguments="$extraCmakeArguments -DCLR_CMAKE_ENABLE_CODE_COVERAGE=1"
fi

commonDir="$__RepoRootDir/eng/common"
__cmakeargs="$__cmakeargs -DCLR_COMMON_DIR=\"$commonDir\""
nextCommand="\"$commonDir/cross/gen-buildsys.sh\" \"$__ProjectRoot\" \"$__ProjectRoot\" \"$intermediatesForBuild\" $platformArch $__Compiler \"$__CompilerMajorVersion\" \"$__CompilerMinorVersion\" $__BuildType $generator $scan_build $extraCmakeArguments $__cmakeargs"
engNativeDir="$__RepoRootDir/eng/native"
__cmakeargs="$__cmakeargs -DCLR_ENG_NATIVE_DIR=\"$engNativeDir\""
nextCommand="\"$engNativeDir/gen-buildsys.sh\" \"$__ProjectRoot\" \"$__ProjectRoot\" \"$intermediatesForBuild\" $platformArch $__Compiler \"$__CompilerMajorVersion\" \"$__CompilerMinorVersion\" $__BuildType $generator $scan_build $extraCmakeArguments $__cmakeargs"
echo "Invoking $nextCommand"
eval $nextCommand

Expand Down
3 changes: 2 additions & 1 deletion src/coreclr/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ endif(CLR_CMAKE_PLATFORM_UNIX)

add_subdirectory(utilcode)
add_subdirectory(gcinfo)
add_subdirectory(coreclr)
add_subdirectory(jit)
add_subdirectory(vm)
add_subdirectory(md)
Expand All @@ -77,4 +76,6 @@ add_subdirectory(ilasm)

if(CLR_CMAKE_PLATFORM_UNIX)
add_subdirectory(palrt)
elseif(WIN32)
add_subdirectory(hosts)
endif(CLR_CMAKE_PLATFORM_UNIX)
4 changes: 0 additions & 4 deletions src/coreclr/src/coreclr/CMakeLists.txt

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/coreclr/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ endif()

# Include global configure settings
include(${CMAKE_CURRENT_SOURCE_DIR}/../configurecompiler.cmake)
include(${CLR_COMMON_DIR}/configuretools.cmake)
include(${CLR_ENG_NATIVE_DIR}/configuretools.cmake)
# Compile options

if (WIN32)
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/Native/Unix/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ function(install_library_and_symbols targetName)
endfunction()

include(configure.cmake)
include(${CLR_COMMON_DIR}/configuretools.cmake)
include(${CLR_ENG_NATIVE_DIR}/configuretools.cmake)

add_subdirectory(System.IO.Compression.Native)

Expand Down
6 changes: 3 additions & 3 deletions src/libraries/Native/build-native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ build_native()
fi

# Regenerate the CMake solution
commonDir="$__rootRepo/eng/common"
__CMakeExtraArgs="$__CMakeExtraArgs -DCLR_COMMON_DIR=\"$commonDir\""
nextCommand="\"$commonDir/cross/gen-buildsys.sh\" \"$__nativeroot\" \"$__nativeroot\" \"$__IntermediatesDir\" $__BuildArch $__Compiler \"$__CompilerMajorVersion\" \"$__CompilerMinorVersion\" $__BuildType $__CMakeArgs $__CMakeExtraArgs"
engNativeDir="$__rootRepo/eng/native"
__CMakeExtraArgs="$__CMakeExtraArgs -DCLR_ENG_NATIVE_DIR=\"$engNativeDir\""
nextCommand="\"$engNativeDir/gen-buildsys.sh\" \"$__nativeroot\" \"$__nativeroot\" \"$__IntermediatesDir\" $__BuildArch $__Compiler \"$__CompilerMajorVersion\" \"$__CompilerMinorVersion\" $__BuildType $__CMakeArgs $__CMakeExtraArgs"
echo "Invoking $nextCommand"
eval "$nextCommand"

Expand Down

0 comments on commit f1dd1d3

Please sign in to comment.