Browse Source

Made the C# end always generate one file per module.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/661/head
Dimitar Dobrev 9 years ago
parent
commit
f197aada99
  1. 7
      build/Tests.lua
  2. 2
      src/Generator/Generator.cs
  3. 4
      src/Generator/Options.cs
  4. 1
      tests/CSharp/CSharp.cs
  5. 2
      tests/Common/premake4.lua
  6. 2
      tests/NamespacesDerived/NamespacesDerived.cs

7
build/Tests.lua

@ -108,7 +108,7 @@ function LinkNUnit() @@ -108,7 +108,7 @@ function LinkNUnit()
}
end
function SetupTestProjectsCSharp(name, depends, extraFiles)
function SetupTestProjectsCSharp(name, depends)
project(name .. ".CSharp")
SetupManagedTestProject()
@ -119,11 +119,6 @@ function SetupTestProjectsCSharp(name, depends, extraFiles) @@ -119,11 +119,6 @@ function SetupTestProjectsCSharp(name, depends, extraFiles)
{
path.join(gendir, name, name .. ".cs"),
}
if extraFiles ~= nil then
for _, file in pairs(extraFiles) do
files { path.join(gendir, name, file .. ".cs") }
end
end
linktable = { "CppSharp.Runtime" }

2
src/Generator/Generator.cs

@ -73,7 +73,7 @@ namespace CppSharp.Generators @@ -73,7 +73,7 @@ namespace CppSharp.Generators
var units = Driver.ASTContext.TranslationUnits.Where(
u => u.IsGenerated && u.HasDeclarations && !u.IsSystemHeader && u.IsValid).ToList();
if (Driver.Options.IsCSharpGenerator && Driver.Options.GenerateSingleCSharpFile)
if (Driver.Options.IsCSharpGenerator)
GenerateSingleTemplate(outputs);
else
GenerateTemplates(outputs, units);

4
src/Generator/Options.cs

@ -192,10 +192,6 @@ namespace CppSharp @@ -192,10 +192,6 @@ namespace CppSharp
public readonly List<string> DependentNameSpaces = new List<string>();
public bool MarshalCharAsManagedChar { get; set; }
/// <summary>
/// Generates a single C# file.
/// </summary>
public bool GenerateSingleCSharpFile { get; set; }
/// <summary>
/// Generates default values of arguments in the C# code.

1
tests/CSharp/CSharp.cs

@ -158,7 +158,6 @@ namespace CppSharp.Tests @@ -158,7 +158,6 @@ namespace CppSharp.Tests
driver.TranslationUnitPasses.AddPass(new CheckMacroPass());
driver.Options.MarshalCharAsManagedChar = true;
driver.Options.GenerateDefaultValuesForArguments = true;
driver.Options.GenerateSingleCSharpFile = true;
}
public override void Preprocess(Driver driver, ASTContext ctx)

2
tests/Common/premake4.lua

@ -1,2 +1,2 @@ @@ -1,2 +1,2 @@
group "Tests/Common"
SetupTestProject("Common", { "AnotherUnit" })
SetupTestProject("Common")

2
tests/NamespacesDerived/NamespacesDerived.cs

@ -29,7 +29,7 @@ namespace CppSharp.Tests @@ -29,7 +29,7 @@ namespace CppSharp.Tests
// Workaround for CLR which does not check for .dll if the name already has a dot
if (System.Type.GetType("Mono.Runtime") == null)
module.SharedLibraryName += ".dll";
module.LibraryName = string.Format("{0}.CSharp", @base);
module.LibraryName = @base;
driver.Options.Modules.Insert(1, module);
}

Loading…
Cancel
Save