Browse Source

Fixed the auto-compilation to work with a custom output directory.

pull/1133/head
Dimitar Dobrev 9 years ago
parent
commit
853fba5ef9
  1. 11
      src/Generator/Driver.cs

11
src/Generator/Driver.cs

@ -383,13 +383,14 @@ namespace CppSharp @@ -383,13 +383,14 @@ namespace CppSharp
public void CompileCode(AST.Module module)
{
var assemblyFile = string.IsNullOrEmpty(module.LibraryName) ?
"out.dll" : module.LibraryName + ".dll";
var assemblyFile = Path.Combine(Options.OutputDir,
string.IsNullOrEmpty(module.LibraryName) ?
"out.dll" : module.LibraryName + ".dll");
var docFile = Path.ChangeExtension(Path.GetFileName(assemblyFile), ".xml");
var docFile = Path.ChangeExtension(assemblyFile, ".xml");
var compilerOptions = new StringBuilder();
compilerOptions.Append(" /doc:" + docFile);
compilerOptions.Append($" /doc:\"{docFile}\"");
compilerOptions.Append(" /debug:pdbonly");
compilerOptions.Append(" /unsafe");
@ -404,7 +405,7 @@ namespace CppSharp @@ -404,7 +405,7 @@ namespace CppSharp
if (module != Options.SystemModule)
compilerParameters.ReferencedAssemblies.Add(
string.Format("{0}.dll", Options.SystemModule.LibraryName));
Path.Combine(Options.OutputDir, $"{Options.SystemModule.LibraryName}.dll"));
// add a reference to System.Core
compilerParameters.ReferencedAssemblies.Add(typeof(Enumerable).Assembly.Location);

Loading…
Cancel
Save