Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
WIP first pass to use subdirectories in publish for native
Browse files Browse the repository at this point in the history
  • Loading branch information
brthor committed Dec 30, 2015
1 parent 7481f10 commit 7909df8
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 17 deletions.
11 changes: 9 additions & 2 deletions scripts/compile/compile-stage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,13 @@ if (Test-Path $OutputDir) {
}

$RuntimeOutputDir = "$OutputDir\runtime\coreclr"
$ILCompilerOutputDir = "$OutputDir\runtime\ilc"

# Publish each project
$Projects | ForEach-Object {
dotnet publish --framework "$Tfm" --runtime "$Rid" --output "$OutputDir\bin" --configuration "$Configuration" "$RepoRoot\src\$_"
dotnet publish --native-subdirectory --framework "$Tfm" --runtime "$Rid" --output "$OutputDir\bin" --configuration "$Configuration" "$RepoRoot\src\$_"
if (!$?) {
Write-Host Command failed: dotnet publish --framework "$Tfm" --runtime "$Rid" --output "$OutputDir\bin" --configuration "$Configuration" "$RepoRoot\src\$_"
Write-Host Command failed: dotnet publish --native-subdirectory --framework "$Tfm" --runtime "$Rid" --output "$OutputDir\bin" --configuration "$Configuration" "$RepoRoot\src\$_"
exit 1
}
}
Expand All @@ -64,6 +65,12 @@ if (!$?) {
Exit 1
}

# Publish ILCompiler
# dotnet publish --framework "$Tfm" --runtime "$Rid" --output "$ILCompilerOutputDir" --configuration "$Configuration" "$RepoRoot\src\Microsoft.DotNet.Runtime"
# if (!$?) {
# Write-Host Command failed: dotnet publish --framework "$Tfm" --runtime "$Rid" --output "$ILCompilerOutputDir" --configuration "$Configuration" "$RepoRoot\src\Microsoft.DotNet.ILCompiler"
# Exit 1
# }

# Clean up bogus additional files
$FilesToClean | ForEach-Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ private void InitializeArgs(NativeCompileSettings config)
// Flags
argsList.Add(cflags);

// TODO: Enable this when https://github.com/dotnet/cli/pull/469 goes through.
// var ilcSdkIncPath = Path.Combine(config.IlcSdkPath, "inc");
var ilcSdkIncPath = config.IlcSdkPath;
var ilcSdkIncPath = Path.Combine(config.IlcSdkPath, "inc");
argsList.Add("-I");
argsList.Add($"\"{ilcSdkIncPath}\"");

Expand All @@ -82,9 +80,10 @@ private void InitializeArgs(NativeCompileSettings config)
}

// ILC SDK Libs
var IlcSdkLibPath = Path.Combine(config.IlcSdkPath, "sdk");
foreach (var lib in IlcSdkLibs)
{
var libPath = Path.Combine(config.IlcSdkPath, lib);
var libPath = Path.Combine(IlcSdkLibPath, lib);
argsList.Add(libPath);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@ private void InitializeArgs(NativeCompileSettings config)
}

// ILC SDK Libs
var IlcSdkLibPath = Path.Combine(config.IlcSdkPath, "sdk");
foreach (var lib in IlcSdkLibs)
{
var libPath = Path.Combine(config.IlcSdkPath, lib);
var libPath = Path.Combine(IlcSdkLibPath, lib);
argsList.Add(libPath);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ private void InitializeArgs(NativeCompileSettings config)
// Flags
argsList.Add(cflags);

// TODO: Enable this when https://github.com/dotnet/cli/pull/469 goes through.
// var ilcSdkIncPath = Path.Combine(config.IlcSdkPath, "inc");
var ilcSdkIncPath = config.IlcSdkPath;
var ilcSdkIncPath = Path.Combine(config.IlcSdkPath, "inc");
argsList.Add("-I");
argsList.Add($"\"{ilcSdkIncPath}\"");

Expand All @@ -87,9 +85,10 @@ private void InitializeArgs(NativeCompileSettings config)
}

// ILC SDK Libs
var IlcSdkLibPath = Path.Combine(config.IlcSdkPath, "sdk");
foreach (var lib in IlcSdkLibs)
{
var libPath = Path.Combine(config.IlcSdkPath, lib);
var libPath = Path.Combine(IlcSdkLibPath, lib);

// Forward the library to linked to the linker
argsList.Add("-Xlinker");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@ private void InitializeArgs(NativeCompileSettings config)
argsList.Add("-Xlinker "+inLibFile);

// ILC SDK Libs
var IlcSdkLibPath = Path.Combine(config.IlcSdkPath, "sdk");
foreach (var lib in IlcSdkLibs)
{
var libPath = Path.Combine(config.IlcSdkPath, lib);
var libPath = Path.Combine(IlcSdkLibPath, lib);
argsList.Add("-Xlinker "+libPath);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ private void InitializeArgs(NativeCompileSettings config)
argsList.Add("/c");

// Add Includes
//
// TODO: Enable this when https://github.com/dotnet/cli/pull/469 goes through.
// var ilcSdkIncPath = Path.Combine(config.IlcSdkPath, "inc");
var ilcSdkIncPath = config.IlcSdkPath;
var ilcSdkIncPath = Path.Combine(config.IlcSdkPath, "inc");
argsList.Add("/I");
argsList.Add($"\"{ilcSdkIncPath}\"");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,10 @@ private void InitializeArgs(NativeCompileSettings config)

// ILC SDK Libs
var SDKLibs = IlcSdkLibMap[config.NativeMode];
var IlcSdkLibPath = Path.Combine(config.IlcSdkPath, "sdk");
foreach (var lib in SDKLibs)
{
var sdkLibPath = Path.Combine(config.IlcSdkPath, lib);
var sdkLibPath = Path.Combine(IlcSdkLibPath, lib);
argsList.Add($"\"{sdkLibPath}\"");
}

Expand Down

0 comments on commit 7909df8

Please sign in to comment.