Merge pull request #843 from schellap/master
Fix host name, debuggability and embed CRT
This commit is contained in:
commit
262274b968
11 changed files with 73 additions and 21 deletions
|
@ -26,7 +26,7 @@ ln -s $INSTALL_DESTINATION/bin/dotnet-run /usr/local/bin/
|
||||||
ln -s $INSTALL_DESTINATION/bin/dotnet-test /usr/local/bin/
|
ln -s $INSTALL_DESTINATION/bin/dotnet-test /usr/local/bin/
|
||||||
ln -s $INSTALL_DESTINATION/bin/dotnet-dnx /usr/local/bin/
|
ln -s $INSTALL_DESTINATION/bin/dotnet-dnx /usr/local/bin/
|
||||||
ln -s $INSTALL_DESTINATION/bin/csc /usr/local/bin/
|
ln -s $INSTALL_DESTINATION/bin/csc /usr/local/bin/
|
||||||
ln -s $INSTALL_DESTINATION/bin/libclihost.dylib /usr/local/bin/
|
ln -s $INSTALL_DESTINATION/bin/libhostpolicy.dylib /usr/local/bin/
|
||||||
|
|
||||||
# A temporary solution to unblock dotnet compile
|
# A temporary solution to unblock dotnet compile
|
||||||
cp $INSTALL_DESTINATION/bin/corehost /usr/local/bin/
|
cp $INSTALL_DESTINATION/bin/corehost /usr/local/bin/
|
||||||
|
|
|
@ -17,25 +17,29 @@ try {
|
||||||
if (Test-Path "env:\ProgramFiles(x86)") {
|
if (Test-Path "env:\ProgramFiles(x86)") {
|
||||||
$pf = (cat "env:\ProgramFiles(x86)")
|
$pf = (cat "env:\ProgramFiles(x86)")
|
||||||
}
|
}
|
||||||
& "$pf\MSBuild\14.0\Bin\MSBuild.exe" ALL_BUILD.vcxproj /p:Configuration="$Configuration"
|
$BuildConfiguration = $Configuration
|
||||||
|
if ($Configuration -eq "Release") {
|
||||||
|
$BuildConfiguration = "RelWithDebInfo"
|
||||||
|
}
|
||||||
|
& "$pf\MSBuild\14.0\Bin\MSBuild.exe" ALL_BUILD.vcxproj /p:Configuration="$BuildConfiguration"
|
||||||
if (!$?) {
|
if (!$?) {
|
||||||
Write-Host "Command failed: $pf\MSBuild\14.0\Bin\MSBuild.exe" ALL_BUILD.vcxproj /p:Configuration="$Configuration"
|
Write-Host "Command failed: $pf\MSBuild\14.0\Bin\MSBuild.exe" ALL_BUILD.vcxproj /p:Configuration="$BuildConfiguration"
|
||||||
Exit 1
|
Exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(Test-Path $HostDir)) {
|
if (!(Test-Path $HostDir)) {
|
||||||
mkdir $HostDir | Out-Null
|
mkdir $HostDir | Out-Null
|
||||||
}
|
}
|
||||||
cp "$RepoRoot\src\corehost\cmake\$Rid\cli\$Configuration\corehost.exe" $HostDir
|
cp "$RepoRoot\src\corehost\cmake\$Rid\cli\$BuildConfiguration\corehost.exe" $HostDir
|
||||||
cp "$RepoRoot\src\corehost\cmake\$Rid\cli\dll\$Configuration\clihost.dll" $HostDir
|
cp "$RepoRoot\src\corehost\cmake\$Rid\cli\dll\$BuildConfiguration\hostpolicy.dll" $HostDir
|
||||||
|
|
||||||
if (Test-Path "$RepoRoot\src\corehost\cmake\$Rid\cli\$Configuration\corehost.pdb")
|
if (Test-Path "$RepoRoot\src\corehost\cmake\$Rid\cli\$BuildConfiguration\corehost.pdb")
|
||||||
{
|
{
|
||||||
cp "$RepoRoot\src\corehost\cmake\$Rid\cli\$Configuration\corehost.pdb" $HostDir
|
cp "$RepoRoot\src\corehost\cmake\$Rid\cli\$BuildConfiguration\corehost.pdb" $HostDir
|
||||||
}
|
}
|
||||||
if (Test-Path "$RepoRoot\src\corehost\cmake\$Rid\cli\dll\$Configuration\clihost.pdb")
|
if (Test-Path "$RepoRoot\src\corehost\cmake\$Rid\cli\dll\$BuildConfiguration\hostpolicy.pdb")
|
||||||
{
|
{
|
||||||
cp "$RepoRoot\src\corehost\cmake\$Rid\cli\dll\$Configuration\clihost.pdb" $HostDir
|
cp "$RepoRoot\src\corehost\cmake\$Rid\cli\dll\$BuildConfiguration\hostpolicy.pdb" $HostDir
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
popd
|
popd
|
||||||
|
|
|
@ -26,9 +26,9 @@ make
|
||||||
# Publish to artifacts
|
# Publish to artifacts
|
||||||
[ -d "$HOST_DIR" ] || mkdir -p $HOST_DIR
|
[ -d "$HOST_DIR" ] || mkdir -p $HOST_DIR
|
||||||
if [[ "$OSNAME" == "osx" ]]; then
|
if [[ "$OSNAME" == "osx" ]]; then
|
||||||
COREHOST_LIBNAME=libclihost.dylib
|
COREHOST_LIBNAME=libhostpolicy.dylib
|
||||||
else
|
else
|
||||||
COREHOST_LIBNAME=libclihost.so
|
COREHOST_LIBNAME=libhostpolicy.so
|
||||||
fi
|
fi
|
||||||
cp "$REPOROOT/src/corehost/cmake/$RID/cli/corehost" $HOST_DIR
|
cp "$REPOROOT/src/corehost/cmake/$RID/cli/corehost" $HOST_DIR
|
||||||
cp "$REPOROOT/src/corehost/cmake/$RID/cli/dll/${COREHOST_LIBNAME}" $HOST_DIR
|
cp "$REPOROOT/src/corehost/cmake/$RID/cli/dll/${COREHOST_LIBNAME}" $HOST_DIR
|
||||||
|
|
|
@ -78,7 +78,7 @@ cp -rec "$RuntimeOutputDir\*" "$OutputDir\bin"
|
||||||
|
|
||||||
# Deploy the CLR host to the output
|
# Deploy the CLR host to the output
|
||||||
cp "$HostDir\corehost.exe" "$OutputDir\bin"
|
cp "$HostDir\corehost.exe" "$OutputDir\bin"
|
||||||
cp "$HostDir\clihost.dll" "$OutputDir\bin"
|
cp "$HostDir\hostpolicy.dll" "$OutputDir\bin"
|
||||||
|
|
||||||
# corehostify externally-provided binaries (csc, vbc, etc.)
|
# corehostify externally-provided binaries (csc, vbc, etc.)
|
||||||
$BinariesForCoreHost | ForEach-Object {
|
$BinariesForCoreHost | ForEach-Object {
|
||||||
|
|
|
@ -77,9 +77,9 @@ cp -R $RUNTIME_OUTPUT_DIR/* $OUTPUT_DIR/bin
|
||||||
|
|
||||||
# Deploy CLR host to the output
|
# Deploy CLR host to the output
|
||||||
if [[ "$OSNAME" == "osx" ]]; then
|
if [[ "$OSNAME" == "osx" ]]; then
|
||||||
COREHOST_LIBNAME=libclihost.dylib
|
COREHOST_LIBNAME=libhostpolicy.dylib
|
||||||
else
|
else
|
||||||
COREHOST_LIBNAME=libclihost.so
|
COREHOST_LIBNAME=libhostpolicy.so
|
||||||
fi
|
fi
|
||||||
cp "$HOST_DIR/corehost" "$OUTPUT_DIR/bin"
|
cp "$HOST_DIR/corehost" "$OUTPUT_DIR/bin"
|
||||||
cp "$HOST_DIR/${COREHOST_LIBNAME}" "$OUTPUT_DIR/bin"
|
cp "$HOST_DIR/${COREHOST_LIBNAME}" "$OUTPUT_DIR/bin"
|
||||||
|
|
|
@ -34,7 +34,7 @@ namespace Microsoft.DotNet.Cli.Utils
|
||||||
public static readonly string HostExecutableName = "corehost" + ExeSuffix;
|
public static readonly string HostExecutableName = "corehost" + ExeSuffix;
|
||||||
public static readonly string[] HostBinaryNames = new string[] {
|
public static readonly string[] HostBinaryNames = new string[] {
|
||||||
HostExecutableName,
|
HostExecutableName,
|
||||||
(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "clihost" : "libclihost") + DynamicLibSuffix
|
(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "hostpolicy" : "libhostpolicy") + DynamicLibSuffix
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,10 +5,13 @@ cmake_minimum_required (VERSION 2.6)
|
||||||
project (corehost)
|
project (corehost)
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "/MTd")
|
add_compile_options($<$<CONFIG:RelWithDebInfo>:/MT>)
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "/MT")
|
add_compile_options($<$<CONFIG:Release>:/MT>)
|
||||||
|
add_compile_options($<$<CONFIG:Debug>:/MTd>)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
include(setup.cmake)
|
||||||
|
|
||||||
set (CMAKE_CXX_STANDARD 11)
|
set (CMAKE_CXX_STANDARD 11)
|
||||||
|
|
||||||
include_directories(../common)
|
include_directories(../common)
|
||||||
|
|
|
@ -2,7 +2,15 @@
|
||||||
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
|
||||||
cmake_minimum_required (VERSION 2.6)
|
cmake_minimum_required (VERSION 2.6)
|
||||||
project(clihost)
|
project(hostpolicy)
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
add_compile_options($<$<CONFIG:RelWithDebInfo>:/MD>)
|
||||||
|
add_compile_options($<$<CONFIG:Release>:/MD>)
|
||||||
|
add_compile_options($<$<CONFIG:Debug>:/MDd>)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(../setup.cmake)
|
||||||
|
|
||||||
include_directories(../../common)
|
include_directories(../../common)
|
||||||
|
|
||||||
|
@ -12,7 +20,7 @@ set(SOURCES
|
||||||
../../common/utils.cpp
|
../../common/utils.cpp
|
||||||
|
|
||||||
../args.cpp
|
../args.cpp
|
||||||
../clihost.cpp
|
../hostpolicy.cpp
|
||||||
../coreclr.cpp
|
../coreclr.cpp
|
||||||
../deps_resolver.cpp
|
../deps_resolver.cpp
|
||||||
../servicing_index.cpp)
|
../servicing_index.cpp)
|
||||||
|
@ -26,5 +34,5 @@ endif()
|
||||||
|
|
||||||
add_definitions(-DCOREHOST_MAKE_DLL=1)
|
add_definitions(-DCOREHOST_MAKE_DLL=1)
|
||||||
|
|
||||||
add_library(clihost SHARED ${SOURCES})
|
add_library(hostpolicy SHARED ${SOURCES})
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
|
||||||
#define LIBHOST_NAME MAKE_LIBNAME("clihost")
|
#define LIBHOST_NAME MAKE_LIBNAME("hostpolicy")
|
||||||
|
|
37
src/corehost/cli/setup.cmake
Normal file
37
src/corehost/cli/setup.cmake
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
# Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||||
|
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
add_definitions(-DWIN32)
|
||||||
|
add_definitions(-D_WIN32=1)
|
||||||
|
if(IS_64BIT_BUILD)
|
||||||
|
add_definitions(-D_WIN64=1)
|
||||||
|
endif()
|
||||||
|
add_compile_options($<$<CONFIG:Debug>:-DDEBUG>)
|
||||||
|
add_compile_options($<$<CONFIG:Debug>:/Od>)
|
||||||
|
add_compile_options($<$<CONFIG:Debug>:/Gm>)
|
||||||
|
add_compile_options(/DEBUG)
|
||||||
|
add_compile_options(/GS)
|
||||||
|
add_compile_options(/W1)
|
||||||
|
add_compile_options(/Zc:inline)
|
||||||
|
add_compile_options(/fp:precise)
|
||||||
|
add_compile_options(/EHsc)
|
||||||
|
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DEBUG")
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /INCREMENTAL:NO")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DEBUG /PDBCOMPRESS")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:1572864")
|
||||||
|
|
||||||
|
# Debug build specific flags
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "/NOVCFEATURE")
|
||||||
|
|
||||||
|
# Release build specific flags
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
|
||||||
|
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
|
||||||
|
|
||||||
|
# RelWithDebInfo specific flags
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /DEBUG /OPT:REF /OPT:ICF")
|
||||||
|
set(CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO} /DEBUG /OPT:REF /OPT:ICF")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /DEBUG /OPT:REF /OPT:ICF")
|
||||||
|
endif()
|
Loading…
Add table
Reference in a new issue