Browse Source

[cli] Adds a new option for automatic compilation of generated code.

pull/914/head
Joao Matos 8 years ago
parent
commit
b31930ad4a
  1. 2
      src/CLI/CLI.cs
  2. 1
      src/CLI/Generator.cs
  3. 2
      src/CLI/Options.cs

2
src/CLI/CLI.cs

@ -24,7 +24,7 @@ namespace CppSharp @@ -24,7 +24,7 @@ namespace CppSharp
optionSet.Add("on=|outputnamespace=", "the {NAMESPACE} that will be used for the generated code", on => options.OutputNamespace = on );
optionSet.Add("iln=|inputlibraryname=", "the {NAME} of the shared library that contains the symbols of the generated code", iln => options.InputLibraryName = iln );
optionSet.Add("c|compile", "enables automatic compilation of the generated code", v => options.Compile = true);
optionSet.Add("g=|gen=|generator=", "the {TYPE} of generated code: 'chsarp' or 'cli' ('cli' supported only for Windows)", g => { GetGeneratorKind(g, messages); } );
optionSet.Add("p=|platform=", "the {PLATFORM} that the generated code will target: 'win', 'osx' or 'linux'", p => { GetDestinationPlatform(p, messages); } );
optionSet.Add("a=|arch=", "the {ARCHITECTURE} that the generated code will target: 'x86' or 'x64'", a => { GetDestinationArchitecture(a, messages); } );

1
src/CLI/Generator.cs

@ -175,6 +175,7 @@ namespace CppSharp @@ -175,6 +175,7 @@ namespace CppSharp
parserOptions.AddDefines(d.Key + "=" + d.Value);
}
driverOptions.CompileCode = options.Compile;
driverOptions.OutputDir = options.OutputDir;
driverOptions.CheckSymbols = options.CheckSymbols;
driverOptions.UnityBuild = options.UnityBuild;

2
src/CLI/Options.cs

@ -42,5 +42,7 @@ namespace CppSharp @@ -42,5 +42,7 @@ namespace CppSharp
public bool UnityBuild { get; set; }
public bool Cpp11ABI { get; set; }
public bool Compile { get; set; }
}
}
Loading…
Cancel
Save