Skip to content

Commit 73e458c

Browse files
committed
Added general-purpose compilation options from Embeddinator.
1 parent 71f60c4 commit 73e458c

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

src/Core/Platform.cs

+10
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@
33

44
namespace CppSharp
55
{
6+
public enum TargetPlatform
7+
{
8+
Windows,
9+
Android,
10+
MacOS,
11+
iOS,
12+
WatchOS,
13+
TVOS
14+
}
15+
616
public static class Platform
717
{
818
public static bool IsWindows

src/Generator/Options.cs

+30
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88

99
namespace CppSharp
1010
{
11+
public enum CompilationTarget
12+
{
13+
SharedLibrary,
14+
StaticLibrary,
15+
Application
16+
}
17+
1118
public class DriverOptions
1219
{
1320
public DriverOptions()
@@ -118,6 +125,29 @@ public bool DoAllModulesHaveLibraries() =>
118125

119126
#endregion
120127

128+
#region Compilation options (Embeddinator-specific for now)
129+
130+
/// <summary>
131+
/// Target platform for code compilation.
132+
/// </summary>
133+
public TargetPlatform Platform;
134+
135+
/// <summary>
136+
/// Specifies the VS version.
137+
/// </summary>
138+
/// <remarks>When null, latest is used.</remarks>
139+
public VisualStudioVersion VsVersion;
140+
141+
// If code compilation is enabled, then sets the compilation target.
142+
public CompilationTarget Target;
143+
144+
// If true, will compile the generated as a shared library / DLL.
145+
public bool CompileSharedLibrary => Target == CompilationTarget.SharedLibrary;
146+
147+
// If true, will force the generation of debug metadata for the native
148+
// and managed code.
149+
public bool DebugMode;
150+
121151
#endregion
122152

123153
#region Generator options

0 commit comments

Comments
 (0)