Update to latest CppSharp.
This commit is contained in:
Родитель
cf8b4d952e
Коммит
24fc9d2bba
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
@ -149,8 +149,8 @@ namespace MonoEmbeddinator4000
|
|||
options.Verbose = Verbose;
|
||||
options.OutputDir = OutputDir;
|
||||
options.CompileCode = CompileCode;
|
||||
options.Target = Target;
|
||||
options.DebugMode = DebugMode;
|
||||
options.Compilation.Target = Target;
|
||||
options.Compilation.DebugMode = DebugMode;
|
||||
|
||||
if (options.OutputDir == null)
|
||||
options.OutputDir = Directory.GetCurrentDirectory();
|
||||
|
@ -171,10 +171,10 @@ namespace MonoEmbeddinator4000
|
|||
}
|
||||
|
||||
var targetPlatform = ConvertToTargetPlatform(Platform);
|
||||
options.Platform = targetPlatform;
|
||||
options.Compilation.Platform = targetPlatform;
|
||||
|
||||
var vsVersion = ConvertToVsVersion(VsVersion);
|
||||
options.VsVersion = vsVersion;
|
||||
options.Compilation.VsVersion = vsVersion;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
|
@ -231,13 +231,13 @@ namespace MonoEmbeddinator4000
|
|||
|
||||
void AotAssemblies()
|
||||
{
|
||||
switch (Options.Platform)
|
||||
switch (Options.Compilation.Platform)
|
||||
{
|
||||
case TargetPlatform.iOS:
|
||||
case TargetPlatform.TVOS:
|
||||
case TargetPlatform.WatchOS:
|
||||
{
|
||||
string aotCompiler = GetAppleAotCompiler(Options.Platform,
|
||||
string aotCompiler = GetAppleAotCompiler(Options.Compilation.Platform,
|
||||
XamarinSdkRoot, is64bits: false);
|
||||
|
||||
// Call the Mono AOT cross compiler for all input assemblies.
|
||||
|
@ -255,7 +255,7 @@ namespace MonoEmbeddinator4000
|
|||
case TargetPlatform.Android:
|
||||
throw new NotSupportedException(string.Format(
|
||||
"AOT cross compilation to target platform '{0}' is not supported.",
|
||||
Options.Platform));
|
||||
Options.Compilation.Platform));
|
||||
case TargetPlatform.MacOS:
|
||||
break;
|
||||
}
|
||||
|
@ -266,7 +266,7 @@ namespace MonoEmbeddinator4000
|
|||
get
|
||||
{
|
||||
var detectAppleSdks = new Xamarin.iOS.Tasks.DetectIPhoneSdks {
|
||||
TargetFrameworkIdentifier = GetXamarinTargetFrameworkName(Options.Platform)
|
||||
TargetFrameworkIdentifier = GetXamarinTargetFrameworkName(Options.Compilation.Platform)
|
||||
};
|
||||
|
||||
if (!detectAppleSdks.Execute())
|
||||
|
@ -300,13 +300,13 @@ namespace MonoEmbeddinator4000
|
|||
{
|
||||
var appName = $"{OutputName}.app";
|
||||
|
||||
switch (Options.Platform)
|
||||
switch (Options.Compilation.Platform)
|
||||
{
|
||||
case TargetPlatform.iOS:
|
||||
case TargetPlatform.TVOS:
|
||||
case TargetPlatform.WatchOS:
|
||||
var sdkName = App.Abi.IsSimulator() ? "Simulator" : string.Empty;
|
||||
return Path.Combine(Options.OutputDir, $"{Options.Platform}{sdkName}",
|
||||
return Path.Combine(Options.OutputDir, $"{Options.Compilation.Platform}{sdkName}",
|
||||
appName);
|
||||
case TargetPlatform.Windows:
|
||||
case TargetPlatform.Android:
|
||||
|
@ -314,7 +314,7 @@ namespace MonoEmbeddinator4000
|
|||
break;
|
||||
}
|
||||
|
||||
return Path.Combine(Options.OutputDir, Options.Platform.ToString(),
|
||||
return Path.Combine(Options.OutputDir, Options.Compilation.Platform.ToString(),
|
||||
App.Abi.ToString(), appName);
|
||||
}
|
||||
|
||||
|
@ -332,13 +332,13 @@ namespace MonoEmbeddinator4000
|
|||
$"--assembly-build-target=@all=framework={OutputName}.framework"
|
||||
};
|
||||
|
||||
if (Options.DebugMode)
|
||||
if (Options.Compilation.DebugMode)
|
||||
args.Add("--debug");
|
||||
|
||||
var targetArg = App.Abi.IsSimulator() ? "--sim" : "--dev";
|
||||
args.Add($"{targetArg} {GetOutputFolder()}");
|
||||
|
||||
var xamarinAppleFramework = GetXamarinTargetFrameworkName(Options.Platform);
|
||||
var xamarinAppleFramework = GetXamarinTargetFrameworkName(Options.Compilation.Platform);
|
||||
var references = new List<string> {
|
||||
Path.Combine(MonoTouchSdk.LibDir, "mono", xamarinAppleFramework, $"{xamarinAppleFramework}.dll"),
|
||||
Path.Combine(MonoTouchSdk.LibDir, "mono", xamarinAppleFramework, "mscorlib.dll")
|
||||
|
@ -408,7 +408,7 @@ namespace MonoEmbeddinator4000
|
|||
string.Join(" ", files.Select(file => Path.GetFullPath(file)))
|
||||
};
|
||||
|
||||
if (Options.DebugMode)
|
||||
if (Options.Compilation.DebugMode)
|
||||
args.Add("-g");
|
||||
|
||||
var invocation = string.Join(" ", args);
|
||||
|
@ -437,14 +437,14 @@ namespace MonoEmbeddinator4000
|
|||
throw new Exception("Visual Studio SDK was not found on your system.");
|
||||
|
||||
ToolchainVersion vsSdk;
|
||||
if (Options.VsVersion == VisualStudioVersion.Latest)
|
||||
if (Options.Compilation.VsVersion == VisualStudioVersion.Latest)
|
||||
vsSdk = vsSdks.LastOrDefault();
|
||||
else
|
||||
{
|
||||
var exactVersion = vsSdks.Where(vs => (int)vs.Version == (int)Options.VsVersion)
|
||||
var exactVersion = vsSdks.Where(vs => (int)vs.Version == (int)Options.Compilation.VsVersion)
|
||||
.Cast<ToolchainVersion?>().SingleOrDefault();
|
||||
if (!exactVersion.HasValue)
|
||||
throw new Exception($"Visual Studio SDK version {Options.VsVersion} was not found on your system.");
|
||||
throw new Exception($"Visual Studio SDK version {Options.Compilation.VsVersion} was not found on your system.");
|
||||
|
||||
vsSdk = exactVersion.Value;
|
||||
}
|
||||
|
@ -462,7 +462,7 @@ namespace MonoEmbeddinator4000
|
|||
$"-I\"{monoPath}\\include\\mono-2.0\"",
|
||||
string.Join(" ", files.Select(file => "\""+ Path.GetFullPath(file) + "\"")),
|
||||
$"\"{monoPath}\\lib\\monosgen-2.0.lib\"",
|
||||
Options.CompileSharedLibrary ? "/LD" : string.Empty,
|
||||
Options.Compilation.CompileSharedLibrary ? "/LD" : string.Empty,
|
||||
$"/Fe{output}"
|
||||
};
|
||||
|
||||
|
@ -502,7 +502,7 @@ namespace MonoEmbeddinator4000
|
|||
var sysroot = Path.Combine (XcodeToolchain.GetXcodeIncludesFolder (), "../..");
|
||||
args.Add ($"-isysroot {sysroot}");
|
||||
|
||||
if (Options.Target == CompilationTarget.SharedLibrary)
|
||||
if (Options.Compilation.Target == CompilationTarget.SharedLibrary)
|
||||
{
|
||||
var name = Path.GetFileNameWithoutExtension(Project.Assemblies[0]);
|
||||
var libName = $"lib{name}.dylib";
|
||||
|
@ -535,7 +535,7 @@ namespace MonoEmbeddinator4000
|
|||
}
|
||||
else if (Platform.IsMacOS)
|
||||
{
|
||||
switch (Options.Platform)
|
||||
switch (Options.Compilation.Platform)
|
||||
{
|
||||
case TargetPlatform.iOS:
|
||||
case TargetPlatform.TVOS:
|
||||
|
@ -545,7 +545,7 @@ namespace MonoEmbeddinator4000
|
|||
case TargetPlatform.Windows:
|
||||
case TargetPlatform.Android:
|
||||
throw new NotSupportedException(
|
||||
$"Cross compilation to target platform '{Options.Platform}' is not supported.");
|
||||
$"Cross compilation to target platform '{Options.Compilation.Platform}' is not supported.");
|
||||
case TargetPlatform.MacOS:
|
||||
CompileClang(files);
|
||||
break;
|
||||
|
|
|
@ -87,6 +87,8 @@ namespace MonoEmbeddinator4000.Generators
|
|||
{
|
||||
public TranslationUnit Unit;
|
||||
|
||||
Options EmbedOptions => Context.Options as Options;
|
||||
|
||||
public CCodeGenerator(BindingContext context,
|
||||
TranslationUnit unit) : base(context, unit)
|
||||
{
|
||||
|
@ -113,7 +115,7 @@ namespace MonoEmbeddinator4000.Generators
|
|||
|
||||
public void WriteInclude(string include)
|
||||
{
|
||||
if (Options.GenerateSupportFiles)
|
||||
if (EmbedOptions.GenerateSupportFiles)
|
||||
WriteLine("#include \"{0}\"", include);
|
||||
else
|
||||
WriteLine("#include <{0}>", include);
|
||||
|
|
|
@ -4,5 +4,12 @@ namespace MonoEmbeddinator4000
|
|||
{
|
||||
public class Options : DriverOptions
|
||||
{
|
||||
// If true, will use unmanaged->managed thunks to call managed methods.
|
||||
// In this mode the JIT will generate specialized wrappers for marshaling
|
||||
// which will be faster but also lead to higher memory consumption.
|
||||
public bool UseUnmanagedThunks;
|
||||
|
||||
// If true, will generate support files alongside generated binding code.
|
||||
public bool GenerateSupportFiles = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -179,11 +179,8 @@
|
|||
<Compile Include="../../external/CppSharp/src/Generator/Passes/GenerateAnonymousDelegatesPass.cs">
|
||||
<Link>Passes/GenerateAnonymousDelegatesPass.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="../../external/CppSharp/src/Generator/Passes/GenerateInlinesPass.cs">
|
||||
<Link>Passes/GenerateInlinesPass.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="../../external/CppSharp/src/Generator/Passes/GenerateTemplatesCodePass.cs">
|
||||
<Link>Passes/GenerateTemplatesCodePass.cs</Link>
|
||||
<Compile Include="../../external/CppSharp/src/Generator/Passes/GenerateSymbolsPass.cs">
|
||||
<Link>Passes/GenerateSymbolsPass.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="../../external/CppSharp/src/Generator/Passes/GetterSetterToPropertyPass.cs">
|
||||
<Link>Passes/GetterSetterToPropertyPass.cs</Link>
|
||||
|
@ -194,9 +191,6 @@
|
|||
<Compile Include="../../external/CppSharp/src/Generator/Passes/IgnoreSystemDeclarationsPass.cs">
|
||||
<Link>Passes/IgnoreSystemDeclarationsPass.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="../../external/CppSharp/src/Generator/Passes/InlinesCodeGenerator.cs">
|
||||
<Link>Passes/InlinesCodeGenerator.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="../../external/CppSharp/src/Generator/Passes/MarkSupportedClassTemplateSpecializationsPass.cs">
|
||||
<Link>Passes/MarkSupportedClassTemplateSpecializationsPass.cs</Link>
|
||||
</Compile>
|
||||
|
@ -236,6 +230,9 @@
|
|||
<Compile Include="../../external/CppSharp/src/Generator/Passes/StripUnusedSystemTypesPass.cs">
|
||||
<Link>Passes/StripUnusedSystemTypesPass.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="../../external/CppSharp/src/Generator/Passes/SymbolsCodeGenerator.cs">
|
||||
<Link>Passes/SymbolsCodeGenerator.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="../../external/CppSharp/src/Generator/Passes/TrimSpecializationsPass.cs">
|
||||
<Link>Passes/TrimSpecializationsPass.cs</Link>
|
||||
</Compile>
|
||||
|
@ -245,11 +242,14 @@
|
|||
<Compile Include="../../external/CppSharp/src/Generator/Types/Std/Stdlib.cs">
|
||||
<Link>Types/Std/Stdlib.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="../../external/CppSharp/src/Generator/Types/TypeIgnoreChecker.cs">
|
||||
<Link>Types/TypeIgnoreChecker.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="../../external/CppSharp/src/Generator/Types/TypeMap.cs">
|
||||
<Link>Types/TypeMap.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="../../external/CppSharp/src/Generator/Types/Types.cs">
|
||||
<Link>Types/Types.cs</Link>
|
||||
<Compile Include="../../external/CppSharp/src/Generator/Types/TypeMapDatabase.cs">
|
||||
<Link>Types/TypeMapDatabase.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="../../external/CppSharp/src/Generator/Utils/BlockGenerator.cs">
|
||||
<Link>Utils/BlockGenerator.cs</Link>
|
||||
|
|
|
@ -41,15 +41,15 @@
|
|||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="../../external/CppSharp/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/CppSharp.CppParser.cs">
|
||||
<Link>i686-apple-darwin12.4.0/CppSharp.CppParser.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="../../external/CppSharp/src/CppParser/Bindings/CSharp/i686-apple-darwin12.4.0/Std.cs">
|
||||
<Link>i686-apple-darwin12.4.0/Std.cs</Link>
|
||||
</Compile>
|
||||
<None Include="../../external/CppSharp/src/CppParser/Bindings/CSharp/premake5.lua">
|
||||
<Link>premake5.lua</Link>
|
||||
</None>
|
||||
<Compile Include="../../external/CppSharp/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/CppSharp.CppParser.cs">
|
||||
<Link>x86_64-apple-darwin12.4.0/CppSharp.CppParser.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="../../external/CppSharp/src/CppParser/Bindings/CSharp/x86_64-apple-darwin12.4.0/Std.cs">
|
||||
<Link>x86_64-apple-darwin12.4.0/Std.cs</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="CppSharp.Runtime.csproj">
|
||||
|
|
|
@ -41,8 +41,14 @@
|
|||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="Microsoft.VisualStudio.Setup.Configuration.Interop">
|
||||
<HintPath>../../external/CppSharp/deps/vs2017/Microsoft.VisualStudio.Setup.Configuration.Interop.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="../../external/CppSharp/src/Core/Compilation.cs">
|
||||
<Link>Compilation.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="../../external/CppSharp/src/Core/Diagnostics.cs">
|
||||
<Link>Diagnostics.cs</Link>
|
||||
</Compile>
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit df9666d6c46800496e79286c9adfa681ffc16ce9
|
||||
Subproject commit 3ac96ac8f29bcbeec7126a5c8e98f9182a113935
|
Загрузка…
Ссылка в новой задаче