Pickup headers from ILCompiler.SDK

Add support for --cppcompilerflags switch to enable passing custom native compiler arguments.
This commit is contained in:
Gaurav Khanna 2015-12-20 20:46:28 -08:00
parent 48facc6231
commit 0b2a6fee2e
13 changed files with 97 additions and 47 deletions

View file

@ -65,20 +65,25 @@ namespace Microsoft.DotNet.Tools.Compiler.Native
// Flags
argsList.Add(cflags);
// Add Includes
// TODO: Enable this when https://github.com/dotnet/cli/pull/469 goes through.
// var ilcSdkIncPath = Path.Combine(config.IlcSdkPath, "inc");
//
// Get the directory name to ensure there are no trailing slashes as they may conflict
// with the terminating " we suffix to account for paths with spaces in them.
var ilcSdkIncPath = Path.GetDirectoryName(config.IlcSdkPath);
argsList.Add("-I");
argsList.Add(Path.Combine(config.AppDepSDKPath, "CPPSdk/ubuntu.14.04"));
argsList.Add("-I");
argsList.Add(Path.Combine(config.AppDepSDKPath, "CPPSdk"));
argsList.Add($"\"{ilcSdkIncPath}\"");
// Input File
var inCppFile = DetermineInFile(config);
argsList.Add(inCppFile);
// Add Stubs
argsList.Add(Path.Combine(config.AppDepSDKPath, "CPPSdk/ubuntu.14.04/lxstubs.cpp"));
// Pass the optional native compiler flags if specified
if (!string.IsNullOrWhiteSpace(config.CppCompilerFlags))
{
argsList.Add(config.CppCompilerFlags);
}
// ILC SDK Libs
foreach (var lib in IlcSdkLibs)
{