[build] Linux fixes.
This commit is contained in:
Родитель
0a18082f18
Коммит
a7028e1646
|
@ -39,7 +39,7 @@ Task("Build-Binder")
|
|||
Task("Generate-Project-Files")
|
||||
.Does(() =>
|
||||
{
|
||||
var os = IsRunningOnWindows() ? "windows" : "macosx";
|
||||
var os = IsRunningOnWindows() ? "windows" : IsRunningOnMacOS() ? "macosx" : "linux";
|
||||
Premake(File("./build/premake5.lua"), $"--outdir=.. --os={os}", "vs2015");
|
||||
});
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ Task("Generate-C")
|
|||
.IsDependentOn("Build-FSharp-Generic")
|
||||
.Does(() =>
|
||||
{
|
||||
var platform = IsRunningOnWindows() ? "Windows" : "macOS";
|
||||
var platform = IsRunningOnWindows() ? "Windows" : IsRunningOnMacOS() ? "macOS" : "Linux";
|
||||
var output = commonDir + Directory("c");
|
||||
Exec(embeddinator, $"-gen=c -out={output} -platform={platform} -target=shared -verbose {managedDll} {fsharpManagedDll}");
|
||||
});
|
||||
|
@ -101,7 +101,7 @@ Task("Build-C-Tests")
|
|||
.Does(() =>
|
||||
{
|
||||
// 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";
|
||||
Premake(commonDir + File("premake5.lua"), os, action);
|
||||
|
||||
|
@ -162,7 +162,7 @@ Task("Generate-Java")
|
|||
.IsDependentOn("Build-Managed")
|
||||
.Does(() =>
|
||||
{
|
||||
var platform = IsRunningOnWindows() ? "Windows" : "macOS";
|
||||
var platform = IsRunningOnWindows() ? "Windows" : IsRunningOnMacOS() ? "macOS" : "Linux";
|
||||
var output = mkDir + Directory("java");
|
||||
Exec(embeddinator, $"-gen=Java -out={output} -platform={platform} -compile -target=shared {managedDll}");
|
||||
});
|
||||
|
@ -213,4 +213,4 @@ Task("Run-Java-Tests")
|
|||
{
|
||||
var java = Directory(javaHome) + File("bin/java");
|
||||
Exec(java, $"-cp {classPath} -Djna.dump_memory=true -Djna.nosys=true org.junit.runner.JUnitCore mono.embeddinator.Tests");
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
bool IsRunningOnMacOS()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void Exec(string path, ProcessSettings settings)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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}");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ function managed_project(name)
|
|||
language "C#"
|
||||
location ("%{wks.location}/build/projects")
|
||||
|
||||
if not os.istarget("macosx") then
|
||||
if os.istarget("windows") then
|
||||
filter { "action:vs*" }
|
||||
location "."
|
||||
filter {}
|
||||
|
@ -109,4 +109,4 @@ workspace "Embeddinator-4000"
|
|||
}
|
||||
|
||||
-- Override VS solution generation so we do not generate anything.
|
||||
premake.override(premake.vstudio.vs2005, "generateSolution", function(base, wks) end)
|
||||
premake.override(premake.vstudio.vs2005, "generateSolution", function(base, wks) end)
|
||||
|
|
Загрузка…
Ссылка в новой задаче