[build] Linux fixes.
This commit is contained in:
Родитель
0a18082f18
Коммит
a7028e1646
|
@ -39,7 +39,7 @@ Task("Build-Binder")
|
||||||
Task("Generate-Project-Files")
|
Task("Generate-Project-Files")
|
||||||
.Does(() =>
|
.Does(() =>
|
||||||
{
|
{
|
||||||
var os = IsRunningOnWindows() ? "windows" : "macosx";
|
var os = IsRunningOnWindows() ? "windows" : IsRunningOnMacOS() ? "macosx" : "linux";
|
||||||
Premake(File("./build/premake5.lua"), $"--outdir=.. --os={os}", "vs2015");
|
Premake(File("./build/premake5.lua"), $"--outdir=.. --os={os}", "vs2015");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@ Task("Generate-C")
|
||||||
.IsDependentOn("Build-FSharp-Generic")
|
.IsDependentOn("Build-FSharp-Generic")
|
||||||
.Does(() =>
|
.Does(() =>
|
||||||
{
|
{
|
||||||
var platform = IsRunningOnWindows() ? "Windows" : "macOS";
|
var platform = IsRunningOnWindows() ? "Windows" : IsRunningOnMacOS() ? "macOS" : "Linux";
|
||||||
var output = commonDir + Directory("c");
|
var output = commonDir + Directory("c");
|
||||||
Exec(embeddinator, $"-gen=c -out={output} -platform={platform} -target=shared -verbose {managedDll} {fsharpManagedDll}");
|
Exec(embeddinator, $"-gen=c -out={output} -platform={platform} -target=shared -verbose {managedDll} {fsharpManagedDll}");
|
||||||
});
|
});
|
||||||
|
@ -101,7 +101,7 @@ Task("Build-C-Tests")
|
||||||
.Does(() =>
|
.Does(() =>
|
||||||
{
|
{
|
||||||
// Generate native project build files using Premake.
|
// Generate native project build files using Premake.
|
||||||
var os = IsRunningOnWindows() ? "--os=windows" : "--os=macosx";
|
var os = IsRunningOnWindows() ? "--os=windows" : IsRunningOnMacOS() ? "--os=macosx" : "--os=linux";
|
||||||
var action = IsRunningOnWindows() ? "vs2015" : "gmake";
|
var action = IsRunningOnWindows() ? "vs2015" : "gmake";
|
||||||
Premake(commonDir + File("premake5.lua"), os, action);
|
Premake(commonDir + File("premake5.lua"), os, action);
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ Task("Generate-Java")
|
||||||
.IsDependentOn("Build-Managed")
|
.IsDependentOn("Build-Managed")
|
||||||
.Does(() =>
|
.Does(() =>
|
||||||
{
|
{
|
||||||
var platform = IsRunningOnWindows() ? "Windows" : "macOS";
|
var platform = IsRunningOnWindows() ? "Windows" : IsRunningOnMacOS() ? "macOS" : "Linux";
|
||||||
var output = mkDir + Directory("java");
|
var output = mkDir + Directory("java");
|
||||||
Exec(embeddinator, $"-gen=Java -out={output} -platform={platform} -compile -target=shared {managedDll}");
|
Exec(embeddinator, $"-gen=Java -out={output} -platform={platform} -compile -target=shared {managedDll}");
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
bool IsRunningOnMacOS()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void Exec(string path, ProcessSettings settings)
|
void Exec(string path, ProcessSettings settings)
|
||||||
{
|
{
|
||||||
if (path.EndsWith(".exe") && !IsRunningOnWindows())
|
if (path.EndsWith(".exe") && !IsRunningOnWindows())
|
||||||
|
@ -24,6 +29,6 @@ void Exec(string path, string args = "", string workingDir = ".")
|
||||||
void Premake(string file, string args, string action)
|
void Premake(string file, string args, string action)
|
||||||
{
|
{
|
||||||
var premakePath = Directory("./external/CppSharp/build/") + (IsRunningOnWindows() ?
|
var premakePath = Directory("./external/CppSharp/build/") + (IsRunningOnWindows() ?
|
||||||
File("premake5.exe") : File("premake5-osx"));
|
File("premake5.exe") : IsRunningOnMacOS() ? File("premake5-osx") : File("premake5-linux-64"));
|
||||||
Exec(premakePath, $"--file={file} {args} {action}");
|
Exec(premakePath, $"--file={file} {args} {action}");
|
||||||
}
|
}
|
|
@ -18,7 +18,7 @@ function managed_project(name)
|
||||||
language "C#"
|
language "C#"
|
||||||
location ("%{wks.location}/build/projects")
|
location ("%{wks.location}/build/projects")
|
||||||
|
|
||||||
if not os.istarget("macosx") then
|
if os.istarget("windows") then
|
||||||
filter { "action:vs*" }
|
filter { "action:vs*" }
|
||||||
location "."
|
location "."
|
||||||
filter {}
|
filter {}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче