This commit is contained in:
Joao Matos 2017-08-30 19:13:13 +01:00
Родитель 0a18082f18
Коммит a7028e1646
4 изменённых файлов: 14 добавлений и 9 удалений

Просмотреть файл

@ -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)