mirror of https://github.com/mono/CppSharp.git
8 changed files with 74 additions and 72 deletions
@ -1,11 +0,0 @@
@@ -1,11 +0,0 @@
|
||||
#include <iostream> |
||||
#include <fstream> |
||||
|
||||
class Hello |
||||
{ |
||||
public: |
||||
Hello (); |
||||
|
||||
void PrintHello(const char* s); |
||||
bool test1(int i, float f); |
||||
}; |
@ -1,7 +0,0 @@
@@ -1,7 +0,0 @@
|
||||
SetupTestGeneratorProject("Hello", "Hello.cs") |
||||
SetupTestNativeProject("Hello.Native", { "Hello.cpp", "Hello.h" }) |
||||
SetupTestProject("Hello.Tests", { "Hello.Tests.cs"}, "Hello") |
||||
|
||||
|
||||
|
||||
|
@ -1,54 +1,54 @@
@@ -1,54 +1,54 @@
|
||||
using Cxxi.Generators; |
||||
using Cxxi.Passes; |
||||
|
||||
namespace Cxxi.Tests |
||||
{ |
||||
class Hello : ILibrary |
||||
{ |
||||
private LanguageGeneratorKind kind; |
||||
|
||||
public Hello(LanguageGeneratorKind kind) |
||||
{ |
||||
this.kind = kind; |
||||
} |
||||
|
||||
public void Setup(DriverOptions options) |
||||
{ |
||||
options.LibraryName = "Hello"; |
||||
options.GeneratorKind = kind; |
||||
options.OutputDir = kind == LanguageGeneratorKind.CPlusPlusCLI ? |
||||
"cli" : "cs"; |
||||
options.Headers.Add("Hello.h"); |
||||
options.IncludeDirs.Add("../../../examples/Hello"); |
||||
} |
||||
|
||||
public void Preprocess(Library lib) |
||||
{ |
||||
} |
||||
|
||||
public void Postprocess(Library lib) |
||||
{ |
||||
} |
||||
|
||||
public void SetupPasses(Driver driver, PassBuilder p) |
||||
{ |
||||
} |
||||
|
||||
public void GenerateStart(TextTemplate template) |
||||
{ |
||||
} |
||||
|
||||
public void GenerateAfterNamespaces(TextTemplate template) |
||||
{ |
||||
} |
||||
|
||||
static class Program |
||||
{ |
||||
public static void Main(string[] args) |
||||
{ |
||||
Driver.Run(new Hello(LanguageGeneratorKind.CPlusPlusCLI)); |
||||
Driver.Run(new Hello(LanguageGeneratorKind.CSharp)); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
using Cxxi.Generators; |
||||
using Cxxi.Passes; |
||||
|
||||
namespace Cxxi.Tests |
||||
{ |
||||
class Hello : ILibrary |
||||
{ |
||||
private readonly LanguageGeneratorKind kind; |
||||
|
||||
public Hello(LanguageGeneratorKind kind) |
||||
{ |
||||
this.kind = kind; |
||||
} |
||||
|
||||
public void Setup(DriverOptions options) |
||||
{ |
||||
options.LibraryName = "Hello"; |
||||
options.GeneratorKind = kind; |
||||
options.OutputDir = kind == LanguageGeneratorKind.CPlusPlusCLI ? |
||||
"cli" : "cs"; |
||||
options.Headers.Add("Hello.h"); |
||||
options.IncludeDirs.Add("../../../examples/Hello"); |
||||
} |
||||
|
||||
public void Preprocess(Library lib) |
||||
{ |
||||
} |
||||
|
||||
public void Postprocess(Library lib) |
||||
{ |
||||
} |
||||
|
||||
public void SetupPasses(Driver driver, PassBuilder p) |
||||
{ |
||||
} |
||||
|
||||
public void GenerateStart(TextTemplate template) |
||||
{ |
||||
} |
||||
|
||||
public void GenerateAfterNamespaces(TextTemplate template) |
||||
{ |
||||
} |
||||
|
||||
static class Program |
||||
{ |
||||
public static void Main(string[] args) |
||||
{ |
||||
Driver.Run(new Hello(LanguageGeneratorKind.CPlusPlusCLI)); |
||||
Driver.Run(new Hello(LanguageGeneratorKind.CSharp)); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,14 @@
@@ -0,0 +1,14 @@
|
||||
#if defined(_MSC_VER) |
||||
#define CXXI_API __declspec(dllexport) |
||||
#else |
||||
#define CXXI_API |
||||
#endif |
||||
|
||||
class CXXI_API Hello |
||||
{ |
||||
public: |
||||
Hello (); |
||||
|
||||
void PrintHello(const char* s); |
||||
bool test1(int i, float f); |
||||
}; |
Loading…
Reference in new issue