Pass ILC Path to DotNet Native Compile
This commit is contained in:
parent
b9666d0fea
commit
31700a0ae9
1 changed files with 12 additions and 2 deletions
|
@ -39,7 +39,8 @@ namespace Microsoft.DotNet.Tools.Compiler
|
||||||
// Native Args
|
// Native Args
|
||||||
var native = app.Option("-n|--native", "Compiles source to native machine code.", CommandOptionType.NoValue);
|
var native = app.Option("-n|--native", "Compiles source to native machine code.", CommandOptionType.NoValue);
|
||||||
var arch = app.Option("-a|--arch <ARCH>", "The architecture for which to compile. x64 only currently supported.", CommandOptionType.SingleValue);
|
var arch = app.Option("-a|--arch <ARCH>", "The architecture for which to compile. x64 only currently supported.", CommandOptionType.SingleValue);
|
||||||
var ilcArgs = app.Option("--ilcargs <ARGS>", "String to pass directory to ilc in native compilation.", CommandOptionType.SingleValue);
|
var ilcArgs = app.Option("--ilcargs <ARGS>", "Command line arguments to be passed directly to ILCompiler.", CommandOptionType.SingleValue);
|
||||||
|
var ilcPath = app.Option("--ilcpath <PATH>", "Path to the folder containing custom built ILCompiler.", CommandOptionType.SingleValue);
|
||||||
var cppMode = app.Option("--cpp", "Flag to do native compilation with C++ code generator.", CommandOptionType.NoValue);
|
var cppMode = app.Option("--cpp", "Flag to do native compilation with C++ code generator.", CommandOptionType.NoValue);
|
||||||
|
|
||||||
app.OnExecute(() =>
|
app.OnExecute(() =>
|
||||||
|
@ -56,6 +57,7 @@ namespace Microsoft.DotNet.Tools.Compiler
|
||||||
var isCppMode = cppMode.HasValue();
|
var isCppMode = cppMode.HasValue();
|
||||||
var archValue = arch.Value();
|
var archValue = arch.Value();
|
||||||
var ilcArgsValue = ilcArgs.Value();
|
var ilcArgsValue = ilcArgs.Value();
|
||||||
|
var ilcPathValue = ilcPath.Value();
|
||||||
var configValue = configuration.Value() ?? Constants.DefaultConfiguration;
|
var configValue = configuration.Value() ?? Constants.DefaultConfiguration;
|
||||||
var outputValue = output.Value();
|
var outputValue = output.Value();
|
||||||
var intermediateValue = intermediateOutput.Value();
|
var intermediateValue = intermediateOutput.Value();
|
||||||
|
@ -70,7 +72,7 @@ namespace Microsoft.DotNet.Tools.Compiler
|
||||||
success &= Compile(context, configValue, outputValue, intermediateOutput.Value(), buildProjectReferences);
|
success &= Compile(context, configValue, outputValue, intermediateOutput.Value(), buildProjectReferences);
|
||||||
if (isNative && success)
|
if (isNative && success)
|
||||||
{
|
{
|
||||||
success &= CompileNative(context, configValue, outputValue, buildProjectReferences, intermediateValue, archValue, ilcArgsValue, isCppMode);
|
success &= CompileNative(context, configValue, outputValue, buildProjectReferences, intermediateValue, archValue, ilcArgsValue, ilcPathValue, isCppMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,6 +102,7 @@ namespace Microsoft.DotNet.Tools.Compiler
|
||||||
string intermediateOutputValue,
|
string intermediateOutputValue,
|
||||||
string archValue,
|
string archValue,
|
||||||
string ilcArgsValue,
|
string ilcArgsValue,
|
||||||
|
string ilcPathValue,
|
||||||
bool isCppMode)
|
bool isCppMode)
|
||||||
{
|
{
|
||||||
var outputPath = GetOutputPath(context, configuration, outputOptionValue);
|
var outputPath = GetOutputPath(context, configuration, outputOptionValue);
|
||||||
|
@ -125,6 +128,13 @@ namespace Microsoft.DotNet.Tools.Compiler
|
||||||
nativeArgs.Add("--ilcargs");
|
nativeArgs.Add("--ilcargs");
|
||||||
nativeArgs.Add($"{ilcArgsValue}");
|
nativeArgs.Add($"{ilcArgsValue}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ILC Path
|
||||||
|
if (!string.IsNullOrWhiteSpace(ilcPathValue))
|
||||||
|
{
|
||||||
|
nativeArgs.Add("--ilcpath");
|
||||||
|
nativeArgs.Add(ilcPathValue);
|
||||||
|
}
|
||||||
|
|
||||||
// CodeGen Mode
|
// CodeGen Mode
|
||||||
if(isCppMode)
|
if(isCppMode)
|
||||||
|
|
Loading…
Add table
Reference in a new issue