Merge remote-tracking branch 'origin/1.1' into 1.2

# Conflicts:
#	Source/Editor/Editor.Build.cs
This commit is contained in:
Wojtek Figat
2021-03-15 09:38:58 +01:00
86 changed files with 4242 additions and 317 deletions

View File

@@ -99,6 +99,23 @@ namespace Flax.Build
// Restore state from PreBuild
Modules.Add("Main");
}
// Mono on Linux is using dynamic linking and needs additional link files
if (buildOptions.Platform.Target == TargetPlatform.Linux)
{
var task = graph.Add<Task>();
task.PrerequisiteFiles.Add(Path.Combine(buildOptions.OutputFolder, "libmonosgen-2.0.so"));
task.ProducedFiles.Add(Path.Combine(buildOptions.OutputFolder, "libmonosgen-2.0.so.1"));
task.WorkingDirectory = buildOptions.OutputFolder;
task.CommandPath = "ln";
task.CommandArguments = "-s -f libmonosgen-2.0.so libmonosgen-2.0.so.1";
task = graph.Add<Task>();
task.PrerequisiteFiles.Add(Path.Combine(buildOptions.OutputFolder, "libmonosgen-2.0.so"));
task.ProducedFiles.Add(Path.Combine(buildOptions.OutputFolder, "libmonosgen-2.0.so.1.0.0"));
task.WorkingDirectory = buildOptions.OutputFolder;
task.CommandPath = "ln";
task.CommandArguments = "-s -f libmonosgen-2.0.so libmonosgen-2.0.so.1.0.0";
}
}
private void BuildMainExecutable(TaskGraph graph, BuildOptions buildOptions)

View File

@@ -103,9 +103,10 @@ namespace Flax.Deploy
private static void BuildEditor()
{
FlaxBuild.Build(Globals.EngineRoot, "FlaxEditor", TargetPlatform.Windows, TargetArchitecture.x64, TargetConfiguration.Debug);
FlaxBuild.Build(Globals.EngineRoot, "FlaxEditor", TargetPlatform.Windows, TargetArchitecture.x64, TargetConfiguration.Development);
FlaxBuild.Build(Globals.EngineRoot, "FlaxEditor", TargetPlatform.Windows, TargetArchitecture.x64, TargetConfiguration.Release);
var targetPlatform = Platform.BuildPlatform.Target;
FlaxBuild.Build(Globals.EngineRoot, "FlaxEditor", targetPlatform, TargetArchitecture.x64, TargetConfiguration.Debug);
FlaxBuild.Build(Globals.EngineRoot, "FlaxEditor", targetPlatform, TargetArchitecture.x64, TargetConfiguration.Development);
FlaxBuild.Build(Globals.EngineRoot, "FlaxEditor", targetPlatform, TargetArchitecture.x64, TargetConfiguration.Release);
}
private static bool CannotBuildPlatform(TargetPlatform platform)

View File

@@ -50,6 +50,10 @@ namespace Flax.Deploy
{
DeployFolder(RootPath, OutputPath, "Source/Platforms/Editor/Windows/Mono");
}
else if (Platform.BuildPlatform.Target == TargetPlatform.Linux)
{
DeployFolder(RootPath, OutputPath, "Source/Platforms/Editor/Linux/Mono");
}
else
{
throw new NotImplementedException();
@@ -120,18 +124,21 @@ namespace Flax.Deploy
}
Log.Info("Compressed editor package size: " + Utilities.GetFileSize(editorPackageZipPath));
Log.Info("Compressing editor debug symbols files...");
editorPackageZipPath = Path.Combine(Deployer.PackageOutputPath, "EditorDebugSymbols.zip");
using (ZipFile zip = new ZipFile())
if (Platform.BuildPlatform.Target == TargetPlatform.Windows)
{
zip.AddDirectory(Path.Combine(Deployer.PackageOutputPath, "EditorDebugSymbols"));
Log.Info("Compressing editor debug symbols files...");
editorPackageZipPath = Path.Combine(Deployer.PackageOutputPath, "EditorDebugSymbols.zip");
using (ZipFile zip = new ZipFile())
{
zip.AddDirectory(Path.Combine(Deployer.PackageOutputPath, "EditorDebugSymbols"));
zip.CompressionLevel = CompressionLevel.BestCompression;
zip.Comment = string.Format("Flax Editor {0}.{1}.{2}\nDate: {3}", Deployer.VersionMajor, Deployer.VersionMinor, Deployer.VersionBuild, DateTime.UtcNow);
zip.CompressionLevel = CompressionLevel.BestCompression;
zip.Comment = string.Format("Flax Editor {0}.{1}.{2}\nDate: {3}", Deployer.VersionMajor, Deployer.VersionMinor, Deployer.VersionBuild, DateTime.UtcNow);
zip.Save(editorPackageZipPath);
zip.Save(editorPackageZipPath);
}
Log.Info("Compressed editor debug symbols package size: " + Utilities.GetFileSize(editorPackageZipPath));
}
Log.Info("Compressed editor debug symbols package size: " + Utilities.GetFileSize(editorPackageZipPath));
// Cleanup
Utilities.DirectoryDelete(OutputPath);
@@ -171,6 +178,25 @@ namespace Flax.Deploy
File.Delete(Path.Combine(dstDebug, "FlaxEngine.CSharp.pdb"));
File.Delete(Path.Combine(dstDebug, "Newtonsoft.Json.pdb"));
}
else if (Platform.BuildPlatform.Target == TargetPlatform.Linux)
{
var binariesSubDir = "Binaries/Editor/Linux/" + configuration;
var src = Path.Combine(RootPath, binariesSubDir);
var dst = Path.Combine(OutputPath, binariesSubDir);
Directory.CreateDirectory(dst);
// Deploy binaries
DeployFile(src, dst, "FlaxEditor");
DeployFile(src, dst, "FlaxEditor.Build.json");
DeployFile(src, dst, "FlaxEngine.CSharp.pdb");
DeployFile(src, dst, "FlaxEngine.CSharp.xml");
DeployFile(src, dst, "Newtonsoft.Json.pdb");
DeployFiles(src, dst, "*.dll");
DeployFiles(src, dst, "*.so");
DeployFile(src, dst, "libmonosgen-2.0.so.1");
DeployFile(src, dst, "libmonosgen-2.0.so.1.0.0");
DeployFile(src, dst, "Logo.png");
}
else
{
throw new NotImplementedException();

View File

@@ -76,9 +76,10 @@ namespace Flax.Deps.Dependencies
RunCmake(root, TargetPlatform.Linux, TargetArchitecture.x64, " -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DASSIMP_NO_EXPORT=ON -DASSIMP_BUILD_ASSIMP_TOOLS=OFF -DASSIMP_BUILD_TESTS=OFF");
Utilities.Run("make", null, null, root, Utilities.RunOptions.None);
var depsFolder = GetThirdPartyFolder(options, TargetPlatform.Linux, TargetArchitecture.x64);
var libName = "libassimp.so.4.1.0";
Utilities.FileCopy(Path.Combine(root, "lib", libName), Path.Combine(depsFolder, libName));
Utilities.Run("strip", libName, null, depsFolder, Utilities.RunOptions.None);
var srcName = "libassimp.so.4.1.0";
var dstName = "libassimp.so";
Utilities.FileCopy(Path.Combine(root, "lib", srcName), Path.Combine(depsFolder, dstName));
Utilities.Run("strip", dstName, null, depsFolder, Utilities.RunOptions.None);
break;
}
}