public void Test_LibDirsContainingSpaces() { if (!CanCompileAndLink) { Assert.Ignore("Compiler, linker or header files are not available" + " or do not match the expected version."); } CleanAllObjs(); CleanAllBins(); Project project = CreateFilebasedProject(_test_compile_only); ExecuteProject(project); LinkTask lt = new LinkTask(); lt.Project = project; lt.Options = "-debug"; lt.OutputFile = new FileInfo(Path.Combine(this.TempDirectory.FullName, "bin/HelloWorld.exe")); lt.LibDirs.BaseDirectory = this.TempDirectory; lt.LibDirs.DirectoryNames.Add("\"whatever you want\""); lt.LibDirs.DirectoryNames.Add("whatever you want"); lt.Sources.BaseDirectory = this.TempDirectory; lt.Sources.Includes.Add("objs\\*.obj"); ExecuteTask(lt); }
public void Test_LibDirsContainingSpaces() { if (!CanCompileAndLink) { return; } CleanAllObjs(); CleanAllBins(); Project project = CreateFilebasedProject(_test_compile_only); ExecuteProject(project); LinkTask lt = new LinkTask(); lt.Project = project; lt.Options = "-debug"; lt.OutputFile = new FileInfo(Path.Combine(this.TempDirectory.FullName, "bin/HelloWorld.exe")); lt.LibDirs.BaseDirectory = this.TempDirectory; lt.LibDirs.DirectoryNames.Add("\"whatever you want\""); lt.LibDirs.DirectoryNames.Add("whatever you want"); lt.Sources.BaseDirectory = this.TempDirectory; lt.Sources.Includes.Add("objs\\*.obj"); ExecuteTask(lt); }
internal override string MapValue(string value) { if (IgnoreEmptyValue && String.IsNullOrEmpty(value)) { return(null); } if (Name == null) { return(LinkTask.QuoteArgumentValue(value)); } return(Name + LinkTask.QuoteArgumentValue(value)); }
// The input file is either a .s or a .bc file BuildTask CreateCompileTask(string assembly_name, string infile_path, Abi abi) { var ext = App.FastDev ? "dylib" : "o"; var ofile = Path.ChangeExtension (infile_path, ext); var install_name = string.Empty; if (App.FastDev) { if (dylibs == null) dylibs = new List<string> (); dylibs.Add (ofile); install_name = "lib" + Path.GetFileName (assembly_name) + ".dylib"; } else { Target.LinkWith (ofile); } if (Application.IsUptodate (new string [] { infile_path, Driver.CompilerPath }, new string [] { ofile })) { Driver.Log (3, "Target {0} is up-to-date.", ofile); return null; } else { Application.TryDelete (ofile); // otherwise the next task might not detect that it will have to rebuild. Driver.Log (3, "Target {0} needs to be rebuilt.", ofile); } var compiler_flags = new CompilerFlags () { Target = Target }; BuildTask bitcode_task = null; BuildTask link_task = null; string link_task_input, link_language = ""; if (App.EnableAsmOnlyBitCode) { link_task_input = infile_path + ".ll"; link_language = ""; // linker_flags.Add (" -fembed-bitcode"); bitcode_task = new BitCodeify () { Input = infile_path, OutputFile = link_task_input, Platform = App.Platform, Abi = abi, DeploymentTarget = App.DeploymentTarget, }; } else { link_task_input = infile_path; if (infile_path.EndsWith (".s")) link_language = "assembler"; } if (App.FastDev) { compiler_flags.AddFrameworks (Frameworks, WeakFrameworks); compiler_flags.AddLinkWith (LinkWith, ForceLoad); compiler_flags.LinkWithMono (); compiler_flags.LinkWithXamarin (); compiler_flags.AddOtherFlags (LinkerFlags); if (Target.GetEntryPoints ().ContainsKey ("UIApplicationMain")) compiler_flags.AddFramework ("UIKit"); } link_task = new LinkTask () { Target = Target, AssemblyName = assembly_name, Abi = abi, InputFile = link_task_input, OutputFile = ofile, InstallName = install_name, CompilerFlags = compiler_flags, SharedLibrary = App.FastDev, Language = link_language, }; if (bitcode_task != null) { bitcode_task.NextTasks = new BuildTask[] { link_task }; return bitcode_task; } return link_task; }
public async Task ExecuteAsync(ILogger logger, string confgiDirectoryRoot) { var linkTask = new LinkTask(logger, this.GetLinkConfigurations(confgiDirectoryRoot)); await linkTask.ExecuteAsync(); }