Compare commits
18 Commits
sdl_platfo
...
sdl_platfo
| Author | SHA1 | Date | |
|---|---|---|---|
| 0f881fbc7a | |||
| 0898f3d020 | |||
| c63e79efa4 | |||
| d0eb85c04f | |||
| a7749abdcc | |||
| 242d24d1a6 | |||
| 853a7510f6 | |||
| 88bd636cbe | |||
| 65df32f5d7 | |||
| 4baa7fb7b8 | |||
| 1644c9c5e0 | |||
| e130ac7d80 | |||
| 45e1d28ba2 | |||
| 12f686262c | |||
| c76b9f206f | |||
| 078485892f | |||
| 44b2db5d5d | |||
| cc401f0316 |
@@ -208,7 +208,7 @@ public:
|
|||||||
typedef typename FallbackAllocation::template Data<T> FallbackData;
|
typedef typename FallbackAllocation::template Data<T> FallbackData;
|
||||||
|
|
||||||
bool _useFallback = false;
|
bool _useFallback = false;
|
||||||
byte _data[Capacity * sizeof(T)];
|
alignas(sizeof(void*)) byte _data[Capacity * sizeof(T)];
|
||||||
FallbackData _fallback;
|
FallbackData _fallback;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -5,6 +5,9 @@
|
|||||||
#include "Types.h"
|
#include "Types.h"
|
||||||
#include "Engine/Core/Types/StringView.h"
|
#include "Engine/Core/Types/StringView.h"
|
||||||
#include "Engine/Core/Types/Guid.h"
|
#include "Engine/Core/Types/Guid.h"
|
||||||
|
#if PLATFORM_ARCH_ARM64
|
||||||
|
#include "Engine/Core/Core.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
class MMethod;
|
class MMethod;
|
||||||
class BinaryModule;
|
class BinaryModule;
|
||||||
|
|||||||
@@ -241,6 +241,10 @@ namespace Flax.Deploy
|
|||||||
|
|
||||||
if (!File.Exists(solutionFile))
|
if (!File.Exists(solutionFile))
|
||||||
{
|
{
|
||||||
|
// CMake VS2026 generator prefers .slnx solution files, just swap the extension for CMake dependencies
|
||||||
|
if (File.Exists(Path.ChangeExtension(solutionFile, "slnx")))
|
||||||
|
solutionFile = Path.ChangeExtension(solutionFile, "slnx");
|
||||||
|
else
|
||||||
throw new Exception(string.Format("Unable to build solution {0}. Solution file not found.", solutionFile));
|
throw new Exception(string.Format("Unable to build solution {0}. Solution file not found.", solutionFile));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,24 @@ namespace Flax.Deps.Dependencies
|
|||||||
get => new[] { TargetPlatform.Windows };
|
get => new[] { TargetPlatform.Windows };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override TargetArchitecture[] Architectures
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch (BuildPlatform)
|
||||||
|
{
|
||||||
|
case TargetPlatform.Windows:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
default: return new TargetArchitecture[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void Build(BuildOptions options)
|
public override void Build(BuildOptions options)
|
||||||
{
|
{
|
||||||
@@ -30,7 +48,7 @@ namespace Flax.Deps.Dependencies
|
|||||||
// Copy files
|
// Copy files
|
||||||
foreach (var platform in options.Platforms)
|
foreach (var platform in options.Platforms)
|
||||||
{
|
{
|
||||||
BuildStarted(platform);
|
BuildStarted(platform, TargetArchitecture.x64);
|
||||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
||||||
Utilities.FileCopy(Path.Combine(root, "ags_lib/lib/amd_ags_x64.lib"), Path.Combine(depsFolder, "amd_ags_x64.lib"));
|
Utilities.FileCopy(Path.Combine(root, "ags_lib/lib/amd_ags_x64.lib"), Path.Combine(depsFolder, "amd_ags_x64.lib"));
|
||||||
Utilities.FileCopy(Path.Combine(root, "ags_lib/lib/amd_ags_x64.dll"), Path.Combine(depsFolder, "amd_ags_x64.dll"));
|
Utilities.FileCopy(Path.Combine(root, "ags_lib/lib/amd_ags_x64.dll"), Path.Combine(depsFolder, "amd_ags_x64.dll"));
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
using Flax.Build;
|
using Flax.Build;
|
||||||
|
|
||||||
namespace Flax.Deps.Dependencies
|
namespace Flax.Deps.Dependencies
|
||||||
@@ -39,6 +40,36 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override TargetArchitecture[] Architectures
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch (BuildPlatform)
|
||||||
|
{
|
||||||
|
case TargetPlatform.Windows:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
case TargetPlatform.Linux:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
//TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
case TargetPlatform.Mac:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
default: return new TargetArchitecture[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void Build(BuildOptions options)
|
public override void Build(BuildOptions options)
|
||||||
{
|
{
|
||||||
@@ -91,7 +122,9 @@ namespace Flax.Deps.Dependencies
|
|||||||
|
|
||||||
foreach (var platform in options.Platforms)
|
foreach (var platform in options.Platforms)
|
||||||
{
|
{
|
||||||
BuildStarted(platform);
|
foreach (var architecture in options.Architectures)
|
||||||
|
{
|
||||||
|
BuildStarted(platform, architecture);
|
||||||
switch (platform)
|
switch (platform)
|
||||||
{
|
{
|
||||||
case TargetPlatform.Windows:
|
case TargetPlatform.Windows:
|
||||||
@@ -105,8 +138,6 @@ namespace Flax.Deps.Dependencies
|
|||||||
|
|
||||||
// Build for Windows
|
// Build for Windows
|
||||||
File.Delete(Path.Combine(root, "CMakeCache.txt"));
|
File.Delete(Path.Combine(root, "CMakeCache.txt"));
|
||||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
|
||||||
{
|
|
||||||
var buildDir = Path.Combine(root, "build-" + architecture);
|
var buildDir = Path.Combine(root, "build-" + architecture);
|
||||||
var solutionPath = Path.Combine(buildDir, "Assimp.sln");
|
var solutionPath = Path.Combine(buildDir, "Assimp.sln");
|
||||||
SetupDirectory(buildDir, true);
|
SetupDirectory(buildDir, true);
|
||||||
@@ -116,8 +147,6 @@ namespace Flax.Deps.Dependencies
|
|||||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||||
foreach (var file in binariesWin)
|
foreach (var file in binariesWin)
|
||||||
Utilities.FileCopy(Path.Combine(buildDir, file), Path.Combine(depsFolder, Path.GetFileName(file)));
|
Utilities.FileCopy(Path.Combine(buildDir, file), Path.Combine(depsFolder, Path.GetFileName(file)));
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TargetPlatform.Linux:
|
case TargetPlatform.Linux:
|
||||||
@@ -126,33 +155,34 @@ namespace Flax.Deps.Dependencies
|
|||||||
{
|
{
|
||||||
{ "CC", "clang-" + Configuration.LinuxClangMinVer },
|
{ "CC", "clang-" + Configuration.LinuxClangMinVer },
|
||||||
{ "CC_FOR_BUILD", "clang-" + Configuration.LinuxClangMinVer },
|
{ "CC_FOR_BUILD", "clang-" + Configuration.LinuxClangMinVer },
|
||||||
{ "CXX", "clang++-" + Configuration.LinuxClangMinVer },
|
{ "CXX", "clang-" + Configuration.LinuxClangMinVer },
|
||||||
|
{ "CMAKE_BUILD_PARALLEL_LEVEL", CmakeBuildParallel },
|
||||||
};
|
};
|
||||||
|
|
||||||
// Build for Linux
|
// Build for Linux
|
||||||
RunCmake(root, platform, TargetArchitecture.x64, " -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF " + globalConfig, envVars);
|
File.Delete(Path.Combine(root, "CMakeCache.txt"));
|
||||||
|
RunCmake(root, platform, architecture, " -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF " + globalConfig, envVars);
|
||||||
Utilities.Run("make", null, null, root, Utilities.RunOptions.ThrowExceptionOnError, envVars);
|
Utilities.Run("make", null, null, root, Utilities.RunOptions.ThrowExceptionOnError, envVars);
|
||||||
configHeaderFilePath = Path.Combine(root, "include", "assimp", "config.h");
|
configHeaderFilePath = Path.Combine(root, "include", "assimp", "config.h");
|
||||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||||
Utilities.FileCopy(Path.Combine(root, "lib", "libassimp.a"), Path.Combine(depsFolder, "libassimp.a"));
|
Utilities.FileCopy(Path.Combine(root, "lib", "libassimp.a"), Path.Combine(depsFolder, "libassimp.a"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TargetPlatform.Mac:
|
case TargetPlatform.Mac:
|
||||||
{
|
{
|
||||||
// Build for Mac
|
// Build for Mac
|
||||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
File.Delete(Path.Combine(root, "CMakeCache.txt"));
|
||||||
{
|
|
||||||
RunCmake(root, platform, architecture, " -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF " + globalConfig);
|
RunCmake(root, platform, architecture, " -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF " + globalConfig);
|
||||||
Utilities.Run("make", null, null, root, Utilities.RunOptions.ThrowExceptionOnError);
|
Utilities.Run("make", null, null, root, Utilities.RunOptions.ThrowExceptionOnError);
|
||||||
configHeaderFilePath = Path.Combine(root, "include", "assimp", "config.h");
|
configHeaderFilePath = Path.Combine(root, "include", "assimp", "config.h");
|
||||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||||
Utilities.FileCopy(Path.Combine(root, "lib", "libassimp.a"), Path.Combine(depsFolder, "libassimp.a"));
|
Utilities.FileCopy(Path.Combine(root, "lib", "libassimp.a"), Path.Combine(depsFolder, "libassimp.a"));
|
||||||
Utilities.Run("make", "clean", null, root, Utilities.RunOptions.ThrowExceptionOnError);
|
Utilities.Run("make", "clean", null, root, Utilities.RunOptions.ThrowExceptionOnError);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Deploy header files and license (preserve module build rules file)
|
// Deploy header files and license (preserve module build rules file)
|
||||||
var srcIncludePath = Path.Combine(root, "include", "assimp");
|
var srcIncludePath = Path.Combine(root, "include", "assimp");
|
||||||
|
|||||||
@@ -28,6 +28,24 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override TargetArchitecture[] Architectures
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch (BuildPlatform)
|
||||||
|
{
|
||||||
|
case TargetPlatform.Windows:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
default: return new TargetArchitecture[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void Build(BuildOptions options)
|
public override void Build(BuildOptions options)
|
||||||
{
|
{
|
||||||
@@ -46,12 +64,12 @@ namespace Flax.Deps.Dependencies
|
|||||||
|
|
||||||
foreach (var platform in options.Platforms)
|
foreach (var platform in options.Platforms)
|
||||||
{
|
{
|
||||||
BuildStarted(platform);
|
foreach (var architecture in options.Architectures)
|
||||||
|
{
|
||||||
|
BuildStarted(platform, architecture);
|
||||||
switch (platform)
|
switch (platform)
|
||||||
{
|
{
|
||||||
case TargetPlatform.Windows:
|
case TargetPlatform.Windows:
|
||||||
{
|
|
||||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
|
||||||
{
|
{
|
||||||
Deploy.VCEnvironment.BuildSolution(solutionPath, configuration, architecture.ToString());
|
Deploy.VCEnvironment.BuildSolution(solutionPath, configuration, architecture.ToString());
|
||||||
var depsFolder = GetThirdPartyFolder(options, TargetPlatform.Windows, architecture);
|
var depsFolder = GetThirdPartyFolder(options, TargetPlatform.Windows, architecture);
|
||||||
|
|||||||
@@ -31,12 +31,32 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override TargetArchitecture[] Architectures
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch (BuildPlatform)
|
||||||
|
{
|
||||||
|
case TargetPlatform.Windows:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
default: return new TargetArchitecture[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void Build(BuildOptions options)
|
public override void Build(BuildOptions options)
|
||||||
{
|
{
|
||||||
foreach (var platform in options.Platforms)
|
foreach (var platform in options.Platforms)
|
||||||
{
|
{
|
||||||
BuildStarted(platform);
|
foreach (var architecture in options.Architectures)
|
||||||
|
{
|
||||||
|
BuildStarted(platform, architecture);
|
||||||
switch (platform)
|
switch (platform)
|
||||||
{
|
{
|
||||||
case TargetPlatform.Windows:
|
case TargetPlatform.Windows:
|
||||||
@@ -45,8 +65,6 @@ namespace Flax.Deps.Dependencies
|
|||||||
var sdkLibLocation = Path.Combine(sdk.Value, "Lib", WindowsPlatformBase.GetSDKVersion(sdk.Key).ToString(), "um");
|
var sdkLibLocation = Path.Combine(sdk.Value, "Lib", WindowsPlatformBase.GetSDKVersion(sdk.Key).ToString(), "um");
|
||||||
string binLocation = Path.Combine(sdk.Value, "bin", WindowsPlatformBase.GetSDKVersion(sdk.Key).ToString());
|
string binLocation = Path.Combine(sdk.Value, "bin", WindowsPlatformBase.GetSDKVersion(sdk.Key).ToString());
|
||||||
|
|
||||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
|
||||||
{
|
|
||||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||||
|
|
||||||
string dxilLocation = @$"{binLocation}\{architecture}\dxil.dll";
|
string dxilLocation = @$"{binLocation}\{architecture}\dxil.dll";
|
||||||
@@ -60,7 +78,6 @@ namespace Flax.Deps.Dependencies
|
|||||||
string d3dcompilerLibLocation = @$"{sdkLibLocation}\{architecture}\d3dcompiler.lib";
|
string d3dcompilerLibLocation = @$"{sdkLibLocation}\{architecture}\d3dcompiler.lib";
|
||||||
Utilities.FileCopy(dxcompilerLibLocation, Path.Combine(depsFolder, Path.GetFileName(dxcompilerLibLocation)));
|
Utilities.FileCopy(dxcompilerLibLocation, Path.Combine(depsFolder, Path.GetFileName(dxcompilerLibLocation)));
|
||||||
Utilities.FileCopy(d3dcompilerLibLocation, Path.Combine(depsFolder, "d3dcompiler_47.lib"));
|
Utilities.FileCopy(d3dcompilerLibLocation, Path.Combine(depsFolder, "d3dcompiler_47.lib"));
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -68,3 +85,4 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -30,6 +30,24 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override TargetArchitecture[] Architectures
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch (BuildPlatform)
|
||||||
|
{
|
||||||
|
case TargetPlatform.Windows:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
default: return new TargetArchitecture[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void Build(BuildOptions options)
|
public override void Build(BuildOptions options)
|
||||||
{
|
{
|
||||||
@@ -47,20 +65,19 @@ namespace Flax.Deps.Dependencies
|
|||||||
|
|
||||||
foreach (var platform in options.Platforms)
|
foreach (var platform in options.Platforms)
|
||||||
{
|
{
|
||||||
BuildStarted(platform);
|
foreach (var architecture in options.Architectures)
|
||||||
|
{
|
||||||
|
BuildStarted(platform, architecture);
|
||||||
switch (platform)
|
switch (platform)
|
||||||
{
|
{
|
||||||
case TargetPlatform.Windows:
|
case TargetPlatform.Windows:
|
||||||
{
|
{
|
||||||
var solutionPath = Path.Combine(root, "DirectXTex_Desktop_2022_Win10.sln");
|
var solutionPath = Path.Combine(root, "DirectXTex_Desktop_2022_Win10.sln");
|
||||||
var binFolder = Path.Combine(root, "DirectXTex", "Bin", "Desktop_2022_Win10");
|
var binFolder = Path.Combine(root, "DirectXTex", "Bin", "Desktop_2022_Win10");
|
||||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
|
||||||
{
|
|
||||||
Deploy.VCEnvironment.BuildSolution(solutionPath, configuration, architecture.ToString());
|
Deploy.VCEnvironment.BuildSolution(solutionPath, configuration, architecture.ToString());
|
||||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||||
foreach (var file in outputFileNames)
|
foreach (var file in outputFileNames)
|
||||||
Utilities.FileCopy(Path.Combine(binFolder, architecture.ToString(), configuration, file), Path.Combine(depsFolder, file));
|
Utilities.FileCopy(Path.Combine(binFolder, architecture.ToString(), configuration, file), Path.Combine(depsFolder, file));
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TargetPlatform.UWP:
|
case TargetPlatform.UWP:
|
||||||
@@ -68,7 +85,7 @@ namespace Flax.Deps.Dependencies
|
|||||||
var solutionPath = Path.Combine(root, "DirectXTex_Windows10_2019.sln");
|
var solutionPath = Path.Combine(root, "DirectXTex_Windows10_2019.sln");
|
||||||
var binFolder = Path.Combine(root, "DirectXTex", "Bin", "Windows10_2019");
|
var binFolder = Path.Combine(root, "DirectXTex", "Bin", "Windows10_2019");
|
||||||
Deploy.VCEnvironment.BuildSolution(solutionPath, configuration, "x64");
|
Deploy.VCEnvironment.BuildSolution(solutionPath, configuration, "x64");
|
||||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||||
foreach (var file in outputFileNames)
|
foreach (var file in outputFileNames)
|
||||||
Utilities.FileCopy(Path.Combine(binFolder, "x64", configuration, file), Path.Combine(depsFolder, file));
|
Utilities.FileCopy(Path.Combine(binFolder, "x64", configuration, file), Path.Combine(depsFolder, file));
|
||||||
break;
|
break;
|
||||||
@@ -87,6 +104,7 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Deploy header files and license file
|
// Deploy header files and license file
|
||||||
var dstIncludePath = Path.Combine(options.ThirdPartyFolder, "DirectXTex");
|
var dstIncludePath = Path.Combine(options.ThirdPartyFolder, "DirectXTex");
|
||||||
|
|||||||
95
Source/Tools/Flax.Build/Deps/Dependencies/EnvDTE.cs
Normal file
95
Source/Tools/Flax.Build/Deps/Dependencies/EnvDTE.cs
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
// Copyright (c) Wojciech Figat. All rights reserved.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.IO.Compression;
|
||||||
|
using System.Linq;
|
||||||
|
using Flax.Build;
|
||||||
|
using Flax.Build.Platforms;
|
||||||
|
|
||||||
|
namespace Flax.Deps.Dependencies
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Visual Studio EnvDTE COM library. https://learn.microsoft.com/en-us/dotnet/api/envdte?view=visualstudiosdk-2022
|
||||||
|
/// </summary>
|
||||||
|
/// <seealso cref="Flax.Deps.Dependency" />
|
||||||
|
class EnvDTE : Dependency
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override TargetPlatform[] Platforms
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch (BuildPlatform)
|
||||||
|
{
|
||||||
|
case TargetPlatform.Windows:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetPlatform.Windows,
|
||||||
|
};
|
||||||
|
default: return new TargetPlatform[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override TargetArchitecture[] Architectures
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch (BuildPlatform)
|
||||||
|
{
|
||||||
|
case TargetPlatform.Windows:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
default: return new TargetArchitecture[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void Build(BuildOptions options)
|
||||||
|
{
|
||||||
|
options.IntermediateFolder.Replace("/" + GetType().Name, "/Microsoft.VisualStudio.Setup.Configuration.Native");
|
||||||
|
|
||||||
|
// Get the source
|
||||||
|
var root = options.IntermediateFolder;
|
||||||
|
var packagePath = Path.Combine(root, $"package.zip");
|
||||||
|
if (!File.Exists(packagePath))
|
||||||
|
{
|
||||||
|
Downloader.DownloadFileFromUrlToPath("https://www.nuget.org/api/v2/package/Microsoft.VisualStudio.Setup.Configuration.Native/3.14.2075", packagePath);
|
||||||
|
}
|
||||||
|
var extractedPath = Path.Combine(root, "extracted");
|
||||||
|
if (!Directory.Exists(extractedPath))
|
||||||
|
{
|
||||||
|
using (ZipArchive archive = ZipFile.Open(packagePath, ZipArchiveMode.Read))
|
||||||
|
archive.ExtractToDirectory(extractedPath);
|
||||||
|
}
|
||||||
|
root = extractedPath;
|
||||||
|
|
||||||
|
foreach (var platform in options.Platforms)
|
||||||
|
{
|
||||||
|
foreach (var architecture in options.Architectures)
|
||||||
|
{
|
||||||
|
BuildStarted(platform, architecture);
|
||||||
|
switch (platform)
|
||||||
|
{
|
||||||
|
case TargetPlatform.Windows:
|
||||||
|
{
|
||||||
|
var bin = Path.Combine(root, "lib", "native", "v141", architecture.ToString().ToLower());
|
||||||
|
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||||
|
Utilities.FileCopy(Path.Combine(bin, "Microsoft.VisualStudio.Setup.Configuration.Native.lib"), Path.Combine(depsFolder, "Microsoft.VisualStudio.Setup.Configuration.Native.lib"));
|
||||||
|
|
||||||
|
var include = Path.Combine(root, "lib", "native", "include");
|
||||||
|
Utilities.FileCopy(Path.Combine(include, "Setup.Configuration.h"), Path.Combine(options.ThirdPartyFolder, "Microsoft.VisualStudio.Setup.Configuration.Native", "Setup.Configuration.h"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -36,6 +36,24 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override TargetArchitecture[] Architectures
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch (BuildPlatform)
|
||||||
|
{
|
||||||
|
case TargetPlatform.Windows:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
default: return new TargetArchitecture[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void Build(BuildOptions options)
|
public override void Build(BuildOptions options)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
// Copyright (c) Wojciech Figat. All rights reserved.
|
// Copyright (c) Wojciech Figat. All rights reserved.
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -50,6 +51,36 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override TargetArchitecture[] Architectures
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch (BuildPlatform)
|
||||||
|
{
|
||||||
|
case TargetPlatform.Windows:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
case TargetPlatform.Linux:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
//TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
case TargetPlatform.Mac:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
default: return new TargetArchitecture[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void Build(BuildOptions options)
|
public override void Build(BuildOptions options)
|
||||||
{
|
{
|
||||||
@@ -59,14 +90,24 @@ namespace Flax.Deps.Dependencies
|
|||||||
// Get the source
|
// Get the source
|
||||||
CloneGitRepoSingleBranch(root, "https://github.com/FlaxEngine/NvCloth.git", "master");
|
CloneGitRepoSingleBranch(root, "https://github.com/FlaxEngine/NvCloth.git", "master");
|
||||||
|
|
||||||
|
// Patch the CMakeLists.txt to support custom compilation flags
|
||||||
|
foreach (var os in new[] { "android", "ios", "linux", "mac", "windows", })
|
||||||
|
{
|
||||||
|
var filePath = Path.Combine(nvCloth, "compiler", "cmake", os, "CMakeLists.txt");
|
||||||
|
var appendLine = "SET(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} ${NVCLOTH_CXX_FLAGS}\")";
|
||||||
|
if (!File.ReadAllText(filePath).Contains(appendLine))
|
||||||
|
File.AppendAllText(filePath, Environment.NewLine + appendLine + Environment.NewLine);
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var platform in options.Platforms)
|
foreach (var platform in options.Platforms)
|
||||||
{
|
{
|
||||||
BuildStarted(platform);
|
foreach (var architecture in options.Architectures)
|
||||||
|
{
|
||||||
|
BuildStarted(platform, architecture);
|
||||||
switch (platform)
|
switch (platform)
|
||||||
{
|
{
|
||||||
case TargetPlatform.Windows:
|
case TargetPlatform.Windows:
|
||||||
Build(options, platform, TargetArchitecture.x64);
|
Build(options, platform, architecture);
|
||||||
Build(options, platform, TargetArchitecture.ARM64);
|
|
||||||
break;
|
break;
|
||||||
case TargetPlatform.XboxOne:
|
case TargetPlatform.XboxOne:
|
||||||
case TargetPlatform.XboxScarlett:
|
case TargetPlatform.XboxScarlett:
|
||||||
@@ -85,17 +126,17 @@ namespace Flax.Deps.Dependencies
|
|||||||
Build(options, platform, TargetArchitecture.ARM64);
|
Build(options, platform, TargetArchitecture.ARM64);
|
||||||
break;
|
break;
|
||||||
case TargetPlatform.Mac:
|
case TargetPlatform.Mac:
|
||||||
Build(options, platform, TargetArchitecture.x64);
|
Build(options, platform, architecture);
|
||||||
Build(options, platform, TargetArchitecture.ARM64);
|
|
||||||
break;
|
break;
|
||||||
case TargetPlatform.iOS:
|
case TargetPlatform.iOS:
|
||||||
Build(options, platform, TargetArchitecture.ARM64);
|
Build(options, platform, TargetArchitecture.ARM64);
|
||||||
break;
|
break;
|
||||||
case TargetPlatform.Linux:
|
case TargetPlatform.Linux:
|
||||||
Build(options, platform, TargetArchitecture.x64);
|
Build(options, platform, architecture);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Copy header files
|
// Copy header files
|
||||||
var dstIncludePath = Path.Combine(options.ThirdPartyFolder, "NvCloth");
|
var dstIncludePath = Path.Combine(options.ThirdPartyFolder, "NvCloth");
|
||||||
@@ -110,7 +151,7 @@ namespace Flax.Deps.Dependencies
|
|||||||
// Peek options
|
// Peek options
|
||||||
var binariesPrefix = string.Empty;
|
var binariesPrefix = string.Empty;
|
||||||
var binariesPostfix = string.Empty;
|
var binariesPostfix = string.Empty;
|
||||||
var cmakeArgs = "-DNV_CLOTH_ENABLE_DX11=0 -DNV_CLOTH_ENABLE_CUDA=0 -DPX_GENERATE_GPU_PROJECTS=0";
|
var cmakeArgs = "-DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DNV_CLOTH_ENABLE_DX11=0 -DNV_CLOTH_ENABLE_CUDA=0 -DPX_GENERATE_GPU_PROJECTS=0";
|
||||||
var cmakeName = string.Empty;
|
var cmakeName = string.Empty;
|
||||||
var buildFolder = Path.Combine(nvCloth, "compiler", platform.ToString() + '_' + architecture.ToString());
|
var buildFolder = Path.Combine(nvCloth, "compiler", platform.ToString() + '_' + architecture.ToString());
|
||||||
var envVars = new Dictionary<string, string>();
|
var envVars = new Dictionary<string, string>();
|
||||||
@@ -153,7 +194,7 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TargetPlatform.Mac:
|
case TargetPlatform.Mac:
|
||||||
cmakeArgs += " -DTARGET_BUILD_PLATFORM=mac";
|
cmakeArgs += " -DTARGET_BUILD_PLATFORM=mac -DNVCLOTH_CXX_FLAGS=\"-Wno-error=poison-system-directories -Wno-error=missing-include-dirs\"";
|
||||||
cmakeName = "mac";
|
cmakeName = "mac";
|
||||||
binariesPrefix = "lib";
|
binariesPrefix = "lib";
|
||||||
break;
|
break;
|
||||||
@@ -163,7 +204,7 @@ namespace Flax.Deps.Dependencies
|
|||||||
binariesPrefix = "lib";
|
binariesPrefix = "lib";
|
||||||
break;
|
break;
|
||||||
case TargetPlatform.Linux:
|
case TargetPlatform.Linux:
|
||||||
cmakeArgs += " -DTARGET_BUILD_PLATFORM=linux";
|
cmakeArgs += " -DTARGET_BUILD_PLATFORM=linux -DNVCLOTH_CXX_FLAGS=\"-Wno-error=poison-system-directories -Wno-error=missing-include-dirs\"";
|
||||||
cmakeName = "linux";
|
cmakeName = "linux";
|
||||||
binariesPrefix = "lib";
|
binariesPrefix = "lib";
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// Copyright (c) Wojciech Figat. All rights reserved.
|
// Copyright (c) Wojciech Figat. All rights reserved.
|
||||||
|
//#define USE_GIT_REPOSITORY
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
@@ -45,18 +45,82 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override TargetArchitecture[] Architectures
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch (BuildPlatform)
|
||||||
|
{
|
||||||
|
case TargetPlatform.Windows:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
case TargetPlatform.Linux:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
//TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
case TargetPlatform.Mac:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
default: return new TargetArchitecture[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void Build(BuildOptions options)
|
public override void Build(BuildOptions options)
|
||||||
{
|
{
|
||||||
var root = options.IntermediateFolder;
|
var root = options.IntermediateFolder;
|
||||||
var version = "1.24.3";
|
var version = "1.24.3";
|
||||||
var configuration = "Release";
|
var configuration = "Release";
|
||||||
|
var cmakeArgs = "-DCMAKE_POLICY_VERSION_MINIMUM=3.5";
|
||||||
var dstIncludePath = Path.Combine(options.ThirdPartyFolder, "OpenAL");
|
var dstIncludePath = Path.Combine(options.ThirdPartyFolder, "OpenAL");
|
||||||
var noSSL = true; // OpenAL Soft website has broken certs
|
var noSSL = true; // OpenAL Soft website has broken certs
|
||||||
|
|
||||||
|
#if !USE_GIT_REPOSITORY
|
||||||
|
if (options.Platforms.Contains(TargetPlatform.Windows))
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
// Get the source
|
||||||
|
CloneGitRepo(root, "https://github.com/kcat/openal-soft.git");
|
||||||
|
GitCheckout(root, "master", "dc7d7054a5b4f3bec1dc23a42fd616a0847af948"); // 1.24.3
|
||||||
|
}
|
||||||
|
#if !USE_GIT_REPOSITORY
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Get the source
|
||||||
|
var packagePath = Path.Combine(root, $"package-{version}.zip");
|
||||||
|
if (!File.Exists(packagePath))
|
||||||
|
{
|
||||||
|
Downloader.DownloadFileFromUrlToPath("https://openal-soft.org/openal-releases/openal-soft-" + version + ".tar.bz2", packagePath, noSSL);
|
||||||
|
if (Platform.BuildTargetPlatform == TargetPlatform.Windows)
|
||||||
|
{
|
||||||
|
// TODO: Maybe use PowerShell Expand-Archive instead?
|
||||||
|
var sevenZip = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "7-Zip", "7z.exe");
|
||||||
|
Utilities.Run(sevenZip, "x package.zip", null, root);
|
||||||
|
Utilities.Run(sevenZip, "x package", null, root);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Utilities.Run("tar", "xjf " + packagePath.Replace('\\', '/'), null, root, Utilities.RunOptions.ConsoleLogOutput);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
foreach (var platform in options.Platforms)
|
foreach (var platform in options.Platforms)
|
||||||
{
|
{
|
||||||
BuildStarted(platform);
|
foreach (var architecture in options.Architectures)
|
||||||
|
{
|
||||||
|
BuildStarted(platform, architecture);
|
||||||
switch (platform)
|
switch (platform)
|
||||||
{
|
{
|
||||||
case TargetPlatform.Windows:
|
case TargetPlatform.Windows:
|
||||||
@@ -67,50 +131,15 @@ namespace Flax.Deps.Dependencies
|
|||||||
"OpenAL32.dll",
|
"OpenAL32.dll",
|
||||||
};
|
};
|
||||||
|
|
||||||
// Get the source
|
// Build for Windows
|
||||||
CloneGitRepo(root, "https://github.com/kcat/openal-soft.git");
|
|
||||||
GitCheckout(root, "master", "dc7d7054a5b4f3bec1dc23a42fd616a0847af948"); // 1.24.3
|
|
||||||
|
|
||||||
// Build for Win64 and ARM64
|
|
||||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
|
||||||
{
|
|
||||||
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
||||||
var solutionPath = Path.Combine(buildDir, "OpenAL.sln");
|
var solutionPath = Path.Combine(buildDir, "OpenAL.sln");
|
||||||
|
SetupDirectory(buildDir, true);
|
||||||
RunCmake(root, platform, architecture, $"-B\"{buildDir}\" -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=\"/D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR /EHsc\" -DCMAKE_CXX_FLAGS=\"/D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR /EHsc\"");
|
RunCmake(root, platform, architecture, $"-B\"{buildDir}\" -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=\"/D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR /EHsc\" -DCMAKE_CXX_FLAGS=\"/D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR /EHsc\" " + cmakeArgs);
|
||||||
Deploy.VCEnvironment.BuildSolution(solutionPath, configuration, architecture.ToString());
|
Deploy.VCEnvironment.BuildSolution(solutionPath, configuration, architecture.ToString());
|
||||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||||
foreach (var file in binariesToCopy)
|
foreach (var file in binariesToCopy)
|
||||||
Utilities.FileCopy(Path.Combine(buildDir, configuration, file), Path.Combine(depsFolder, Path.GetFileName(file)));
|
Utilities.FileCopy(Path.Combine(buildDir, configuration, file), Path.Combine(depsFolder, Path.GetFileName(file)));
|
||||||
}
|
|
||||||
|
|
||||||
#if false
|
|
||||||
// Get the binaries
|
|
||||||
var packagePath = Path.Combine(root, "package.zip");
|
|
||||||
if (!File.Exists(packagePath))
|
|
||||||
Downloader.DownloadFileFromUrlToPath("https://openal-soft.org/openal-binaries/openal-soft-" + version + "-bin.zip", packagePath, noSSL);
|
|
||||||
using (ZipArchive archive = ZipFile.Open(packagePath, ZipArchiveMode.Read))
|
|
||||||
{
|
|
||||||
if (!Directory.Exists(root))
|
|
||||||
archive.ExtractToDirectory(root);
|
|
||||||
root = Path.Combine(root, archive.Entries.First().FullName);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deploy Win64 binaries
|
|
||||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
|
||||||
Utilities.FileCopy(Path.Combine(root, "bin", "Win64", "soft_oal.dll"), Path.Combine(depsFolder, "OpenAL32.dll"));
|
|
||||||
Utilities.FileCopy(Path.Combine(root, "libs", "Win64", "OpenAL32.lib"), Path.Combine(depsFolder, "OpenAL32.lib"));
|
|
||||||
|
|
||||||
// Deploy license
|
|
||||||
Utilities.FileCopy(Path.Combine(root, "COPYING"), Path.Combine(dstIncludePath, "COPYING"), true);
|
|
||||||
|
|
||||||
// Deploy header files
|
|
||||||
var files = Directory.GetFiles(Path.Combine(root, "include", "AL"));
|
|
||||||
foreach (var file in files)
|
|
||||||
{
|
|
||||||
Utilities.FileCopy(file, Path.Combine(dstIncludePath, Path.GetFileName(file)));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TargetPlatform.Linux:
|
case TargetPlatform.Linux:
|
||||||
@@ -131,23 +160,20 @@ namespace Flax.Deps.Dependencies
|
|||||||
$"-DALSOFT_REQUIRE_PULSEAUDIO=ON " +
|
$"-DALSOFT_REQUIRE_PULSEAUDIO=ON " +
|
||||||
$"-DALSOFT_REQUIRE_JACK=ON " +
|
$"-DALSOFT_REQUIRE_JACK=ON " +
|
||||||
$"-DALSOFT_REQUIRE_PIPEWIRE=ON " +
|
$"-DALSOFT_REQUIRE_PIPEWIRE=ON " +
|
||||||
$"-DALSOFT_EMBED_HRTF_DATA=YES ";
|
$"-DALSOFT_EMBED_HRTF_DATA=YES "
|
||||||
|
+ cmakeArgs;
|
||||||
// Get the source
|
|
||||||
var packagePath = Path.Combine(root, "package.zip");
|
|
||||||
File.Delete(packagePath);
|
|
||||||
Downloader.DownloadFileFromUrlToPath("https://openal-soft.org/openal-releases/openal-soft-" + version + ".tar.bz2", packagePath, noSSL);
|
|
||||||
Utilities.Run("tar", "xjf " + packagePath.Replace('\\', '/'), null, root, Utilities.RunOptions.ConsoleLogOutput);
|
|
||||||
|
|
||||||
// Use separate build directory
|
// Use separate build directory
|
||||||
|
#if !USE_GIT_REPOSITORY
|
||||||
root = Path.Combine(root, "openal-soft-" + version);
|
root = Path.Combine(root, "openal-soft-" + version);
|
||||||
var buildDir = Path.Combine(root, "build");
|
#endif
|
||||||
|
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
||||||
SetupDirectory(buildDir, true);
|
SetupDirectory(buildDir, true);
|
||||||
|
|
||||||
// Build for Linux
|
// Build for Linux
|
||||||
Utilities.Run("cmake", $"-G \"Unix Makefiles\" -DCMAKE_BUILD_TYPE={configuration} -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DLIBTYPE=STATIC {config} ..", null, buildDir, Utilities.RunOptions.ConsoleLogOutput, envVars);
|
RunCmake(root, platform, architecture, $"-B\"{buildDir}\" -DLIBTYPE=STATIC -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=" + configuration + config, envVars);
|
||||||
BuildCmake(buildDir, configuration, envVars);
|
BuildCmake(buildDir, configuration, envVars);
|
||||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||||
foreach (var file in binariesToCopy)
|
foreach (var file in binariesToCopy)
|
||||||
Utilities.FileCopy(Path.Combine(buildDir, file), Path.Combine(depsFolder, file));
|
Utilities.FileCopy(Path.Combine(buildDir, file), Path.Combine(depsFolder, file));
|
||||||
break;
|
break;
|
||||||
@@ -162,30 +188,17 @@ namespace Flax.Deps.Dependencies
|
|||||||
{
|
{
|
||||||
{ "CMAKE_BUILD_PARALLEL_LEVEL", CmakeBuildParallel },
|
{ "CMAKE_BUILD_PARALLEL_LEVEL", CmakeBuildParallel },
|
||||||
};
|
};
|
||||||
var config = " -DALSOFT_REQUIRE_OBOE=OFF -DALSOFT_REQUIRE_OPENSL=ON -DALSOFT_EMBED_HRTF_DATA=YES";
|
var config = "-DALSOFT_REQUIRE_OBOE=OFF -DALSOFT_REQUIRE_OPENSL=ON -DALSOFT_EMBED_HRTF_DATA=YES " + cmakeArgs;
|
||||||
|
|
||||||
// Get the source
|
|
||||||
var packagePath = Path.Combine(root, "package.zip");
|
|
||||||
File.Delete(packagePath);
|
|
||||||
Downloader.DownloadFileFromUrlToPath("https://openal-soft.org/openal-releases/openal-soft-" + version + ".tar.bz2", packagePath, noSSL);
|
|
||||||
if (Platform.BuildTargetPlatform == TargetPlatform.Windows)
|
|
||||||
{
|
|
||||||
var sevenZip = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "7-Zip", "7z.exe");
|
|
||||||
Utilities.Run(sevenZip, "x package.zip", null, root);
|
|
||||||
Utilities.Run(sevenZip, "x package", null, root);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Utilities.Run("tar", "xjf " + packagePath.Replace('\\', '/'), null, root, Utilities.RunOptions.ConsoleLogOutput);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Use separate build directory
|
// Use separate build directory
|
||||||
|
#if !USE_GIT_REPOSITORY
|
||||||
root = Path.Combine(root, "openal-soft-" + version);
|
root = Path.Combine(root, "openal-soft-" + version);
|
||||||
var buildDir = Path.Combine(root, "build");
|
#endif
|
||||||
|
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
||||||
SetupDirectory(buildDir, true);
|
SetupDirectory(buildDir, true);
|
||||||
|
|
||||||
// Build
|
// Build
|
||||||
RunCmake(buildDir, platform, TargetArchitecture.ARM64, ".. -DLIBTYPE=STATIC -DCMAKE_BUILD_TYPE=" + configuration + config, envVars);
|
RunCmake(root, platform, TargetArchitecture.ARM64, $"-B\"{buildDir}\" -DLIBTYPE=STATIC -DCMAKE_BUILD_TYPE=" + configuration + config, envVars);
|
||||||
BuildCmake(buildDir, envVars);
|
BuildCmake(buildDir, envVars);
|
||||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.ARM64);
|
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.ARM64);
|
||||||
foreach (var file in binariesToCopy)
|
foreach (var file in binariesToCopy)
|
||||||
@@ -202,28 +215,21 @@ namespace Flax.Deps.Dependencies
|
|||||||
{
|
{
|
||||||
{ "CMAKE_BUILD_PARALLEL_LEVEL", CmakeBuildParallel },
|
{ "CMAKE_BUILD_PARALLEL_LEVEL", CmakeBuildParallel },
|
||||||
};
|
};
|
||||||
var config = " -DALSOFT_REQUIRE_COREAUDIO=ON -DALSOFT_EMBED_HRTF_DATA=YES";
|
var config = " -DALSOFT_REQUIRE_COREAUDIO=ON -DALSOFT_EMBED_HRTF_DATA=YES " + cmakeArgs;
|
||||||
|
|
||||||
// Get the source
|
|
||||||
var packagePath = Path.Combine(root, "package.zip");
|
|
||||||
File.Delete(packagePath);
|
|
||||||
Downloader.DownloadFileFromUrlToPath("https://openal-soft.org/openal-releases/openal-soft-" + version + ".tar.bz2", packagePath, noSSL);
|
|
||||||
Utilities.Run("tar", "xjf " + packagePath.Replace('\\', '/'), null, root, Utilities.RunOptions.ConsoleLogOutput);
|
|
||||||
|
|
||||||
// Use separate build directory
|
// Use separate build directory
|
||||||
|
#if !USE_GIT_REPOSITORY
|
||||||
root = Path.Combine(root, "openal-soft-" + version);
|
root = Path.Combine(root, "openal-soft-" + version);
|
||||||
var buildDir = Path.Combine(root, "build");
|
#endif
|
||||||
|
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
||||||
|
SetupDirectory(buildDir, true);
|
||||||
|
|
||||||
// Build for Mac
|
// Build for Mac
|
||||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
RunCmake(root, platform, architecture, $"-B\"{buildDir}\" -DLIBTYPE=STATIC -DCMAKE_BUILD_TYPE=" + configuration + config, envVars);
|
||||||
{
|
|
||||||
SetupDirectory(buildDir, true);
|
|
||||||
RunCmake(buildDir, platform, architecture, ".. -DLIBTYPE=STATIC -DCMAKE_BUILD_TYPE=" + configuration + config, envVars);
|
|
||||||
BuildCmake(buildDir, envVars);
|
BuildCmake(buildDir, envVars);
|
||||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||||
foreach (var file in binariesToCopy)
|
foreach (var file in binariesToCopy)
|
||||||
Utilities.FileCopy(Path.Combine(buildDir, file), Path.Combine(depsFolder, file));
|
Utilities.FileCopy(Path.Combine(buildDir, file), Path.Combine(depsFolder, file));
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TargetPlatform.iOS:
|
case TargetPlatform.iOS:
|
||||||
@@ -236,23 +242,17 @@ namespace Flax.Deps.Dependencies
|
|||||||
{
|
{
|
||||||
{ "CMAKE_BUILD_PARALLEL_LEVEL", CmakeBuildParallel },
|
{ "CMAKE_BUILD_PARALLEL_LEVEL", CmakeBuildParallel },
|
||||||
};
|
};
|
||||||
var config = " -DALSOFT_REQUIRE_COREAUDIO=ON -DALSOFT_EMBED_HRTF_DATA=YES";
|
var config = " -DALSOFT_REQUIRE_COREAUDIO=ON -DALSOFT_EMBED_HRTF_DATA=YES " + cmakeArgs;
|
||||||
|
|
||||||
// Get the source
|
|
||||||
var packagePath = Path.Combine(root, "package.zip");
|
|
||||||
if (!File.Exists(packagePath))
|
|
||||||
{
|
|
||||||
Downloader.DownloadFileFromUrlToPath("https://openal-soft.org/openal-releases/openal-soft-" + version + ".tar.bz2", packagePath, noSSL);
|
|
||||||
Utilities.Run("tar", "xjf " + packagePath.Replace('\\', '/'), null, root, Utilities.RunOptions.ConsoleLogOutput);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Use separate build directory
|
// Use separate build directory
|
||||||
|
#if !USE_GIT_REPOSITORY
|
||||||
root = Path.Combine(root, "openal-soft-" + version);
|
root = Path.Combine(root, "openal-soft-" + version);
|
||||||
var buildDir = Path.Combine(root, "build");
|
#endif
|
||||||
|
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
||||||
|
SetupDirectory(buildDir, true);
|
||||||
|
|
||||||
// Build for iOS
|
// Build for iOS
|
||||||
SetupDirectory(buildDir, true);
|
RunCmake(root, platform, TargetArchitecture.ARM64, $"-B\"{buildDir}\" -DCMAKE_SYSTEM_NAME=iOS -DALSOFT_OSX_FRAMEWORK=ON -DLIBTYPE=STATIC -DCMAKE_BUILD_TYPE=" + configuration + config, envVars);
|
||||||
RunCmake(buildDir, platform, TargetArchitecture.ARM64, ".. -DCMAKE_SYSTEM_NAME=iOS -DALSOFT_OSX_FRAMEWORK=ON -DLIBTYPE=STATIC -DCMAKE_BUILD_TYPE=" + configuration + config, envVars);
|
|
||||||
BuildCmake(buildDir, envVars);
|
BuildCmake(buildDir, envVars);
|
||||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.ARM64);
|
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.ARM64);
|
||||||
foreach (var file in binariesToCopy)
|
foreach (var file in binariesToCopy)
|
||||||
@@ -262,5 +262,16 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Deploy license
|
||||||
|
Utilities.FileCopy(Path.Combine(root, "COPYING"), Path.Combine(dstIncludePath, "COPYING"), true);
|
||||||
|
|
||||||
|
// Deploy header files
|
||||||
|
var files = Directory.GetFiles(Path.Combine(root, "include", "AL"));
|
||||||
|
foreach (var file in files)
|
||||||
|
{
|
||||||
|
Utilities.FileCopy(file, Path.Combine(dstIncludePath, Path.GetFileName(file)));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,36 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override TargetArchitecture[] Architectures
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch (BuildPlatform)
|
||||||
|
{
|
||||||
|
case TargetPlatform.Windows:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
case TargetPlatform.Linux:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
//TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
case TargetPlatform.Mac:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
default: return new TargetArchitecture[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private string root;
|
private string root;
|
||||||
private string projectGenDir;
|
private string projectGenDir;
|
||||||
private string projectGenPath;
|
private string projectGenPath;
|
||||||
@@ -65,8 +95,13 @@ namespace Flax.Deps.Dependencies
|
|||||||
if (cmakeSwitch.HasAttribute("name") && cmakeSwitch.Attributes["name"].Value == name)
|
if (cmakeSwitch.HasAttribute("name") && cmakeSwitch.Attributes["name"].Value == name)
|
||||||
{
|
{
|
||||||
cmakeSwitch.Attributes["value"].Value = value;
|
cmakeSwitch.Attributes["value"].Value = value;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
var child = cmakeSwitches.OwnerDocument.CreateElement(cmakeSwitches.ChildNodes[0].Name);
|
||||||
|
child.SetAttribute("name", name);
|
||||||
|
child.SetAttribute("value", value);
|
||||||
|
cmakeSwitches.AppendChild(child);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Build(BuildOptions options, string preset, TargetPlatform targetPlatform, TargetArchitecture architecture)
|
private void Build(BuildOptions options, string preset, TargetPlatform targetPlatform, TargetArchitecture architecture)
|
||||||
@@ -94,11 +129,14 @@ namespace Flax.Deps.Dependencies
|
|||||||
case TargetPlatform.Windows:
|
case TargetPlatform.Windows:
|
||||||
if (architecture == TargetArchitecture.ARM64)
|
if (architecture == TargetArchitecture.ARM64)
|
||||||
{
|
{
|
||||||
// Windows ARM64 doesn't have GPU support, so avoid copying those DLLs around
|
// Windows ARM64 doesn't have precompiled files for GPU support, so avoid copying those DLLs around
|
||||||
ConfigureCmakeSwitch(cmakeSwitches, "PX_COPY_EXTERNAL_DLL", "OFF");
|
ConfigureCmakeSwitch(cmakeSwitches, "PX_COPY_EXTERNAL_DLL", "OFF");
|
||||||
ConfigureCmakeSwitch(cmakeParams, "PX_COPY_EXTERNAL_DLL", "OFF");
|
ConfigureCmakeSwitch(cmakeParams, "PX_COPY_EXTERNAL_DLL", "OFF");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case TargetPlatform.Linux:
|
||||||
|
ConfigureCmakeSwitch(cmakeParams, "PHYSX_CXX_FLAGS", "\"-Wno-error=format -Wno-error=unused-but-set-variable -Wno-error=switch-default -Wno-error=invalid-offsetof -Wno-error=unsafe-buffer-usage -Wno-error=unsafe-buffer-usage-in-libc-call -Wno-error=missing-include-dirs\"");
|
||||||
|
break;
|
||||||
case TargetPlatform.Android:
|
case TargetPlatform.Android:
|
||||||
ConfigureCmakeSwitch(cmakeParams, "CMAKE_INSTALL_PREFIX", $"install/android-{Configuration.AndroidPlatformApi}/PhysX");
|
ConfigureCmakeSwitch(cmakeParams, "CMAKE_INSTALL_PREFIX", $"install/android-{Configuration.AndroidPlatformApi}/PhysX");
|
||||||
ConfigureCmakeSwitch(cmakeParams, "ANDROID_NATIVE_API_LEVEL", $"android-{Configuration.AndroidPlatformApi}");
|
ConfigureCmakeSwitch(cmakeParams, "ANDROID_NATIVE_API_LEVEL", $"android-{Configuration.AndroidPlatformApi}");
|
||||||
@@ -106,6 +144,7 @@ namespace Flax.Deps.Dependencies
|
|||||||
break;
|
break;
|
||||||
case TargetPlatform.Mac:
|
case TargetPlatform.Mac:
|
||||||
ConfigureCmakeSwitch(cmakeParams, "CMAKE_OSX_DEPLOYMENT_TARGET", Configuration.MacOSXMinVer);
|
ConfigureCmakeSwitch(cmakeParams, "CMAKE_OSX_DEPLOYMENT_TARGET", Configuration.MacOSXMinVer);
|
||||||
|
ConfigureCmakeSwitch(cmakeParams, "PHYSX_CXX_FLAGS", "\"-Wno-error=format -Wno-error=unused-but-set-variable -Wno-error=switch-default -Wno-error=invalid-offsetof -Wno-error=unsafe-buffer-usage -Wno-error=unsafe-buffer-usage-in-libc-call -Wno-error=missing-include-dirs\"");
|
||||||
break;
|
break;
|
||||||
case TargetPlatform.iOS:
|
case TargetPlatform.iOS:
|
||||||
ConfigureCmakeSwitch(cmakeParams, "CMAKE_OSX_DEPLOYMENT_TARGET", Configuration.iOSMinVer);
|
ConfigureCmakeSwitch(cmakeParams, "CMAKE_OSX_DEPLOYMENT_TARGET", Configuration.iOSMinVer);
|
||||||
@@ -122,10 +161,11 @@ namespace Flax.Deps.Dependencies
|
|||||||
string bits;
|
string bits;
|
||||||
string arch;
|
string arch;
|
||||||
string binariesSubDir;
|
string binariesSubDir;
|
||||||
string buildPlatform;
|
string buildPlatform = architecture == TargetArchitecture.x86 ? "Win32" : architecture.ToString();
|
||||||
bool suppressBitsPostfix = false;
|
bool suppressBitsPostfix = false;
|
||||||
string binariesPrefix = string.Empty;
|
string binariesPrefix = string.Empty;
|
||||||
var envVars = new Dictionary<string, string>();
|
var envVars = new Dictionary<string, string>();
|
||||||
|
envVars.Add("CMAKE_BUILD_PARALLEL_LEVEL", CmakeBuildParallel);
|
||||||
switch (architecture)
|
switch (architecture)
|
||||||
{
|
{
|
||||||
case TargetArchitecture.x86:
|
case TargetArchitecture.x86:
|
||||||
@@ -146,15 +186,6 @@ namespace Flax.Deps.Dependencies
|
|||||||
break;
|
break;
|
||||||
default: throw new InvalidArchitectureException(architecture);
|
default: throw new InvalidArchitectureException(architecture);
|
||||||
}
|
}
|
||||||
switch (architecture)
|
|
||||||
{
|
|
||||||
case TargetArchitecture.x86:
|
|
||||||
buildPlatform = "Win32";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
buildPlatform = architecture.ToString();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
var msBuildProps = new Dictionary<string, string>();
|
var msBuildProps = new Dictionary<string, string>();
|
||||||
switch (targetPlatform)
|
switch (targetPlatform)
|
||||||
{
|
{
|
||||||
@@ -383,18 +414,37 @@ namespace Flax.Deps.Dependencies
|
|||||||
|
|
||||||
foreach (var platform in options.Platforms)
|
foreach (var platform in options.Platforms)
|
||||||
{
|
{
|
||||||
BuildStarted(platform);
|
foreach (var architecture in options.Architectures)
|
||||||
|
{
|
||||||
|
BuildStarted(platform, architecture);
|
||||||
switch (platform)
|
switch (platform)
|
||||||
{
|
{
|
||||||
case TargetPlatform.Windows:
|
case TargetPlatform.Windows:
|
||||||
{
|
{
|
||||||
Build(options, "vc17win64", platform, TargetArchitecture.x64);
|
if (architecture == TargetArchitecture.x64 || architecture == TargetArchitecture.ARM64)
|
||||||
Build(options, "vc17win-arm64", platform, TargetArchitecture.ARM64);
|
{
|
||||||
|
if (WindowsPlatform.GetToolsets().Any(x => x.Key == WindowsPlatformToolset.v145))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Build(options, architecture == TargetArchitecture.x64 ? "vc18win64" : "vc18win-arm64", platform, architecture);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Log.Warning($"Failed to generate VS2026 solution for PhysX, fallback to VS2022: {e.Message}");
|
||||||
|
Build(options, architecture == TargetArchitecture.x64 ? "vc17win64" : "vc17win-arm64", platform, architecture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Build(options, architecture == TargetArchitecture.x64 ? "vc17win64" : "vc17win-arm64", platform, architecture);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
throw new InvalidArchitectureException(architecture);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TargetPlatform.Linux:
|
case TargetPlatform.Linux:
|
||||||
{
|
{
|
||||||
Build(options, "linux", platform, TargetArchitecture.x64);
|
Build(options, "linux", platform, architecture);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TargetPlatform.PS4:
|
case TargetPlatform.PS4:
|
||||||
@@ -428,8 +478,12 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
case TargetPlatform.Mac:
|
case TargetPlatform.Mac:
|
||||||
{
|
{
|
||||||
Build(options, "mac64", platform, TargetArchitecture.x64);
|
if (architecture == TargetArchitecture.x64)
|
||||||
Build(options, "mac-arm64", platform, TargetArchitecture.ARM64);
|
Build(options, "mac64", platform, architecture);
|
||||||
|
else if (architecture == TargetArchitecture.ARM64)
|
||||||
|
Build(options, "mac-arm64", platform, architecture);
|
||||||
|
else
|
||||||
|
throw new InvalidArchitectureException(architecture);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TargetPlatform.iOS:
|
case TargetPlatform.iOS:
|
||||||
@@ -439,12 +493,13 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Copy header files
|
// Copy header files
|
||||||
var dstIncludePath = Path.Combine(options.ThirdPartyFolder, "PhysX");
|
var dstIncludePath = Path.Combine(options.ThirdPartyFolder, "PhysX");
|
||||||
Directory.GetFiles(dstIncludePath, "*.h", SearchOption.AllDirectories).ToList().ForEach(File.Delete);
|
Directory.GetFiles(dstIncludePath, "*.h", SearchOption.AllDirectories).ToList().ForEach(File.Delete);
|
||||||
Utilities.FileCopy(Path.Combine(root, "LICENSE.md"), Path.Combine(dstIncludePath, "License.txt"));
|
Utilities.FileCopy(Path.Combine(root, "LICENSE.md"), Path.Combine(dstIncludePath, "License.txt"));
|
||||||
Utilities.DirectoryCopy(Path.Combine(root, "physx", "include"), dstIncludePath);
|
Utilities.DirectoryCopy(Path.Combine(root, "physx", "include"), dstIncludePath, true, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,36 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override TargetArchitecture[] Architectures
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch (BuildPlatform)
|
||||||
|
{
|
||||||
|
case TargetPlatform.Windows:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
case TargetPlatform.Linux:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
//TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
case TargetPlatform.Mac:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
default: return new TargetArchitecture[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void Build(BuildOptions options)
|
public override void Build(BuildOptions options)
|
||||||
{
|
{
|
||||||
@@ -94,12 +124,12 @@ namespace Flax.Deps.Dependencies
|
|||||||
|
|
||||||
foreach (var platform in options.Platforms)
|
foreach (var platform in options.Platforms)
|
||||||
{
|
{
|
||||||
BuildStarted(platform);
|
foreach (var architecture in options.Architectures)
|
||||||
|
{
|
||||||
|
BuildStarted(platform, architecture);
|
||||||
switch (platform)
|
switch (platform)
|
||||||
{
|
{
|
||||||
case TargetPlatform.Windows:
|
case TargetPlatform.Windows:
|
||||||
{
|
|
||||||
foreach (var architecture in new TargetArchitecture[] { TargetArchitecture.x64/*, TargetArchitecture.ARM64*/ })
|
|
||||||
{
|
{
|
||||||
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
||||||
|
|
||||||
@@ -120,13 +150,11 @@ namespace Flax.Deps.Dependencies
|
|||||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||||
foreach (var file in binariesToCopy)
|
foreach (var file in binariesToCopy)
|
||||||
Utilities.FileCopy(Path.Combine(buildDir, configuration, file), Path.Combine(depsFolder, file == "SDL3-static.lib" ? "SDL3.lib" : file));
|
Utilities.FileCopy(Path.Combine(buildDir, configuration, file), Path.Combine(depsFolder, file == "SDL3-static.lib" ? "SDL3.lib" : file));
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TargetPlatform.Linux:
|
case TargetPlatform.Linux:
|
||||||
case TargetPlatform.Mac:
|
case TargetPlatform.Mac:
|
||||||
{
|
|
||||||
foreach (var architecture in new [] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
|
||||||
{
|
{
|
||||||
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
||||||
|
|
||||||
@@ -146,11 +174,11 @@ namespace Flax.Deps.Dependencies
|
|||||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||||
foreach (var file in binariesToCopy)
|
foreach (var file in binariesToCopy)
|
||||||
Utilities.FileCopy(Path.Combine(buildDir, file), Path.Combine(depsFolder, file));
|
Utilities.FileCopy(Path.Combine(buildDir, file), Path.Combine(depsFolder, file));
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Backup files
|
// Backup files
|
||||||
var dstPath = Path.Combine(options.ThirdPartyFolder, "SDL");
|
var dstPath = Path.Combine(options.ThirdPartyFolder, "SDL");
|
||||||
|
|||||||
@@ -29,6 +29,36 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override TargetArchitecture[] Architectures
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch (BuildPlatform)
|
||||||
|
{
|
||||||
|
case TargetPlatform.Windows:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
case TargetPlatform.Linux:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
//TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
case TargetPlatform.Mac:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
default: return new TargetArchitecture[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void Build(BuildOptions options)
|
public override void Build(BuildOptions options)
|
||||||
{
|
{
|
||||||
@@ -47,25 +77,25 @@ namespace Flax.Deps.Dependencies
|
|||||||
|
|
||||||
foreach (var platform in options.Platforms)
|
foreach (var platform in options.Platforms)
|
||||||
{
|
{
|
||||||
BuildStarted(platform);
|
foreach (var architecture in options.Architectures)
|
||||||
|
{
|
||||||
|
BuildStarted(platform, architecture);
|
||||||
switch (platform)
|
switch (platform)
|
||||||
{
|
{
|
||||||
case TargetPlatform.Windows:
|
case TargetPlatform.Windows:
|
||||||
{
|
{
|
||||||
// Build for Win64
|
// Build for Windows
|
||||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
|
||||||
{
|
|
||||||
Deploy.VCEnvironment.BuildSolution(solutionPath, configuration, architecture.ToString(), new Dictionary<string, string>() { { "RestorePackagesConfig", "true" } });
|
Deploy.VCEnvironment.BuildSolution(solutionPath, configuration, architecture.ToString(), new Dictionary<string, string>() { { "RestorePackagesConfig", "true" } });
|
||||||
var depsFolder = GetThirdPartyFolder(options, TargetPlatform.Windows, architecture);
|
var depsFolder = GetThirdPartyFolder(options, TargetPlatform.Windows, architecture);
|
||||||
foreach (var file in outputFileNames)
|
foreach (var file in outputFileNames)
|
||||||
{
|
{
|
||||||
Utilities.FileCopy(Path.Combine(binFolder, architecture.ToString(), "Release", file), Path.Combine(depsFolder, file));
|
Utilities.FileCopy(Path.Combine(binFolder, architecture.ToString(), "Release", file), Path.Combine(depsFolder, file));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Deploy header files and license file
|
// Deploy header files and license file
|
||||||
var dstIncludePath = Path.Combine(options.ThirdPartyFolder, "UVAtlas");
|
var dstIncludePath = Path.Combine(options.ThirdPartyFolder, "UVAtlas");
|
||||||
|
|||||||
@@ -29,6 +29,24 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override TargetArchitecture[] Architectures
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch (BuildPlatform)
|
||||||
|
{
|
||||||
|
case TargetPlatform.Linux:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
default: return new TargetArchitecture[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void Build(BuildOptions options)
|
public override void Build(BuildOptions options)
|
||||||
{
|
{
|
||||||
@@ -38,7 +56,7 @@ namespace Flax.Deps.Dependencies
|
|||||||
|
|
||||||
foreach (var platform in options.Platforms)
|
foreach (var platform in options.Platforms)
|
||||||
{
|
{
|
||||||
BuildStarted(platform);
|
BuildStarted(platform, TargetArchitecture.AnyCPU);
|
||||||
switch (platform)
|
switch (platform)
|
||||||
{
|
{
|
||||||
case TargetPlatform.Linux:
|
case TargetPlatform.Linux:
|
||||||
|
|||||||
@@ -0,0 +1,91 @@
|
|||||||
|
// Copyright (c) Wojciech Figat. All rights reserved.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.IO.Compression;
|
||||||
|
using System.Linq;
|
||||||
|
using Flax.Build;
|
||||||
|
using Flax.Build.Platforms;
|
||||||
|
|
||||||
|
namespace Flax.Deps.Dependencies
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// WinPixEventRuntime. https://github.com/microsoft/PixEvents
|
||||||
|
/// </summary>
|
||||||
|
/// <seealso cref="Flax.Deps.Dependency" />
|
||||||
|
class WinPixEventRuntime : Dependency
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override TargetPlatform[] Platforms
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch (BuildPlatform)
|
||||||
|
{
|
||||||
|
case TargetPlatform.Windows:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetPlatform.Windows,
|
||||||
|
};
|
||||||
|
default: return new TargetPlatform[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override TargetArchitecture[] Architectures
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch (BuildPlatform)
|
||||||
|
{
|
||||||
|
case TargetPlatform.Windows:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
default: return new TargetArchitecture[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void Build(BuildOptions options)
|
||||||
|
{
|
||||||
|
// Get the source
|
||||||
|
var root = options.IntermediateFolder;
|
||||||
|
var packagePath = Path.Combine(root, $"package.zip");
|
||||||
|
if (!File.Exists(packagePath))
|
||||||
|
{
|
||||||
|
Downloader.DownloadFileFromUrlToPath("https://www.nuget.org/api/v2/package/WinPixEventRuntime/1.0.240308001", packagePath);
|
||||||
|
}
|
||||||
|
var extractedPath = Path.Combine(root, "extracted");
|
||||||
|
if (!Directory.Exists(extractedPath))
|
||||||
|
{
|
||||||
|
using (ZipArchive archive = ZipFile.Open(packagePath, ZipArchiveMode.Read))
|
||||||
|
archive.ExtractToDirectory(extractedPath);
|
||||||
|
}
|
||||||
|
root = extractedPath;
|
||||||
|
|
||||||
|
foreach (var platform in options.Platforms)
|
||||||
|
{
|
||||||
|
foreach (var architecture in options.Architectures)
|
||||||
|
{
|
||||||
|
BuildStarted(platform, architecture);
|
||||||
|
switch (platform)
|
||||||
|
{
|
||||||
|
case TargetPlatform.Windows:
|
||||||
|
{
|
||||||
|
var bin = Path.Combine(root, "bin", architecture.ToString());
|
||||||
|
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||||
|
Utilities.FileCopy(Path.Combine(bin, "WinPixEventRuntime.dll"), Path.Combine(depsFolder, "WinPixEventRuntime.dll"));
|
||||||
|
Utilities.FileCopy(Path.Combine(bin, "WinPixEventRuntime.lib"), Path.Combine(depsFolder, "WinPixEventRuntime.lib"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -34,6 +34,30 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override TargetArchitecture[] Architectures
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch (BuildPlatform)
|
||||||
|
{
|
||||||
|
case TargetPlatform.Windows:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
case TargetPlatform.Mac:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
default: return new TargetArchitecture[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void Build(BuildOptions options)
|
public override void Build(BuildOptions options)
|
||||||
{
|
{
|
||||||
@@ -45,12 +69,12 @@ namespace Flax.Deps.Dependencies
|
|||||||
|
|
||||||
foreach (var platform in options.Platforms)
|
foreach (var platform in options.Platforms)
|
||||||
{
|
{
|
||||||
BuildStarted(platform);
|
foreach (var architecture in options.Architectures)
|
||||||
|
{
|
||||||
|
BuildStarted(platform, architecture);
|
||||||
switch (platform)
|
switch (platform)
|
||||||
{
|
{
|
||||||
case TargetPlatform.Windows:
|
case TargetPlatform.Windows:
|
||||||
|
|
||||||
foreach (var architecture in new []{ TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
|
||||||
{
|
{
|
||||||
string buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
string buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
||||||
var isa = architecture == TargetArchitecture.ARM64 ? "-DASTCENC_ISA_NEON=ON" : "-DASTCENC_ISA_SSE2=ON";
|
var isa = architecture == TargetArchitecture.ARM64 ? "-DASTCENC_ISA_NEON=ON" : "-DASTCENC_ISA_SSE2=ON";
|
||||||
@@ -63,7 +87,6 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TargetPlatform.Mac:
|
case TargetPlatform.Mac:
|
||||||
foreach (var architecture in new []{ TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
|
||||||
{
|
{
|
||||||
string buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
string buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
||||||
var isa = architecture == TargetArchitecture.ARM64 ? "-DASTCENC_ISA_NEON=ON" : "-DASTCENC_ISA_SSE2=ON";
|
var isa = architecture == TargetArchitecture.ARM64 ? "-DASTCENC_ISA_NEON=ON" : "-DASTCENC_ISA_SSE2=ON";
|
||||||
@@ -77,6 +100,7 @@ namespace Flax.Deps.Dependencies
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Copy header and license
|
// Copy header and license
|
||||||
Utilities.FileCopy(Path.Combine(root, "LICENSE.txt"), Path.Combine(options.ThirdPartyFolder, "astc/LICENSE.txt"));
|
Utilities.FileCopy(Path.Combine(root, "LICENSE.txt"), Path.Combine(options.ThirdPartyFolder, "astc/LICENSE.txt"));
|
||||||
|
|||||||
@@ -41,6 +41,36 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override TargetArchitecture[] Architectures
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch (BuildPlatform)
|
||||||
|
{
|
||||||
|
case TargetPlatform.Windows:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
case TargetPlatform.Linux:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
//TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
case TargetPlatform.Mac:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
default: return new TargetArchitecture[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void Build(BuildOptions options)
|
public override void Build(BuildOptions options)
|
||||||
{
|
{
|
||||||
@@ -69,14 +99,14 @@ namespace Flax.Deps.Dependencies
|
|||||||
|
|
||||||
foreach (var platform in options.Platforms)
|
foreach (var platform in options.Platforms)
|
||||||
{
|
{
|
||||||
BuildStarted(platform);
|
foreach (var architecture in options.Architectures)
|
||||||
|
{
|
||||||
|
BuildStarted(platform, architecture);
|
||||||
switch (platform)
|
switch (platform)
|
||||||
{
|
{
|
||||||
case TargetPlatform.Windows:
|
case TargetPlatform.Windows:
|
||||||
{
|
{
|
||||||
// Build for Win64 and ARM64
|
// Build for Windows
|
||||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
|
||||||
{
|
|
||||||
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
||||||
var solutionPath = Path.Combine(buildDir, "CURL.sln");
|
var solutionPath = Path.Combine(buildDir, "CURL.sln");
|
||||||
|
|
||||||
@@ -85,7 +115,6 @@ namespace Flax.Deps.Dependencies
|
|||||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||||
foreach (var file in binariesToCopyWin)
|
foreach (var file in binariesToCopyWin)
|
||||||
Utilities.FileCopy(Path.Combine(buildDir, "lib", configuration, file), Path.Combine(depsFolder, Path.GetFileName(file)));
|
Utilities.FileCopy(Path.Combine(buildDir, "lib", configuration, file), Path.Combine(depsFolder, Path.GetFileName(file)));
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TargetPlatform.Linux:
|
case TargetPlatform.Linux:
|
||||||
@@ -94,7 +123,7 @@ namespace Flax.Deps.Dependencies
|
|||||||
var settings = new[]
|
var settings = new[]
|
||||||
{
|
{
|
||||||
"--without-librtmp",
|
"--without-librtmp",
|
||||||
"--without-ssl",
|
//"--without-ssl",
|
||||||
"--with-gnutls",
|
"--with-gnutls",
|
||||||
"--disable-ipv6",
|
"--disable-ipv6",
|
||||||
"--disable-manual",
|
"--disable-manual",
|
||||||
@@ -133,8 +162,7 @@ namespace Flax.Deps.Dependencies
|
|||||||
"--enable-static",
|
"--enable-static",
|
||||||
"-disable-ldap --disable-sspi --disable-ftp --disable-file --disable-dict --disable-telnet --disable-tftp --disable-rtsp --disable-pop3 --disable-imap --disable-smtp --disable-gopher --disable-smb",
|
"-disable-ldap --disable-sspi --disable-ftp --disable-file --disable-dict --disable-telnet --disable-tftp --disable-rtsp --disable-pop3 --disable-imap --disable-smtp --disable-gopher --disable-smb",
|
||||||
};
|
};
|
||||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
|
||||||
{
|
|
||||||
var arch = GetAppleArchName(architecture);
|
var arch = GetAppleArchName(architecture);
|
||||||
var archName = arch + "-apple-darwin19";
|
var archName = arch + "-apple-darwin19";
|
||||||
if (architecture == TargetArchitecture.ARM64)
|
if (architecture == TargetArchitecture.ARM64)
|
||||||
@@ -161,11 +189,11 @@ namespace Flax.Deps.Dependencies
|
|||||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||||
var filename = "libcurl.a";
|
var filename = "libcurl.a";
|
||||||
Utilities.FileCopy(Path.Combine(buildDir, "lib", filename), Path.Combine(depsFolder, filename));
|
Utilities.FileCopy(Path.Combine(buildDir, "lib", filename), Path.Combine(depsFolder, filename));
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Backup files
|
// Backup files
|
||||||
var srcIncludePath = Path.Combine(root, "include", "curl");
|
var srcIncludePath = Path.Combine(root, "include", "curl");
|
||||||
|
|||||||
@@ -30,25 +30,42 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override TargetArchitecture[] Architectures
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch (BuildPlatform)
|
||||||
|
{
|
||||||
|
case TargetPlatform.Windows:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
default: return new TargetArchitecture[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void Build(BuildOptions options)
|
public override void Build(BuildOptions options)
|
||||||
{
|
{
|
||||||
foreach (var platform in options.Platforms)
|
foreach (var platform in options.Platforms)
|
||||||
{
|
{
|
||||||
BuildStarted(platform);
|
foreach (var architecture in options.Architectures)
|
||||||
|
{
|
||||||
|
BuildStarted(platform, architecture);
|
||||||
switch (platform)
|
switch (platform)
|
||||||
{
|
{
|
||||||
case TargetPlatform.Windows:
|
case TargetPlatform.Windows:
|
||||||
{
|
{
|
||||||
var sdk = WindowsPlatformBase.GetSDKs().Last();
|
var sdk = WindowsPlatformBase.GetSDKs().Last();
|
||||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
|
||||||
{
|
|
||||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||||
var libLocation = @$"{sdk.Value}Debuggers\lib\{architecture}\dbghelp.lib";
|
var libLocation = @$"{sdk.Value}Debuggers\lib\{architecture}\dbghelp.lib";
|
||||||
var dllLocation = @$"{sdk.Value}Debuggers\{architecture}\dbghelp.dll";
|
var dllLocation = @$"{sdk.Value}Debuggers\{architecture}\dbghelp.dll";
|
||||||
Utilities.FileCopy(libLocation, Path.Combine(depsFolder, Path.GetFileName(libLocation)));
|
Utilities.FileCopy(libLocation, Path.Combine(depsFolder, Path.GetFileName(libLocation)));
|
||||||
Utilities.FileCopy(dllLocation, Path.Combine(depsFolder, Path.GetFileName(dllLocation)));
|
Utilities.FileCopy(dllLocation, Path.Combine(depsFolder, Path.GetFileName(dllLocation)));
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -56,3 +73,4 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -49,6 +49,36 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override TargetArchitecture[] Architectures
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch (BuildPlatform)
|
||||||
|
{
|
||||||
|
case TargetPlatform.Windows:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
case TargetPlatform.Linux:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
//TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
case TargetPlatform.Mac:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
default: return new TargetArchitecture[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void Build(BuildOptions options)
|
public override void Build(BuildOptions options)
|
||||||
{
|
{
|
||||||
@@ -94,7 +124,9 @@ namespace Flax.Deps.Dependencies
|
|||||||
|
|
||||||
foreach (var platform in options.Platforms)
|
foreach (var platform in options.Platforms)
|
||||||
{
|
{
|
||||||
BuildStarted(platform);
|
foreach (var architecture in options.Architectures)
|
||||||
|
{
|
||||||
|
BuildStarted(platform, architecture);
|
||||||
switch (platform)
|
switch (platform)
|
||||||
{
|
{
|
||||||
case TargetPlatform.Windows:
|
case TargetPlatform.Windows:
|
||||||
@@ -103,13 +135,10 @@ namespace Flax.Deps.Dependencies
|
|||||||
File.WriteAllText(vcxprojPath, vcxprojContents);
|
File.WriteAllText(vcxprojPath, vcxprojContents);
|
||||||
|
|
||||||
// Build for Windows
|
// Build for Windows
|
||||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
|
||||||
{
|
|
||||||
Deploy.VCEnvironment.BuildSolution(vsSolutionPath, configurationMsvc, architecture.ToString(), msvcProps);
|
Deploy.VCEnvironment.BuildSolution(vsSolutionPath, configurationMsvc, architecture.ToString(), msvcProps);
|
||||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||||
foreach (var filename in binariesToCopyMsvc)
|
foreach (var filename in binariesToCopyMsvc)
|
||||||
Utilities.FileCopy(Path.Combine(root, "objs", architecture.ToString(), configurationMsvc, filename), Path.Combine(depsFolder, filename));
|
Utilities.FileCopy(Path.Combine(root, "objs", architecture.ToString(), configurationMsvc, filename), Path.Combine(depsFolder, filename));
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TargetPlatform.Linux:
|
case TargetPlatform.Linux:
|
||||||
@@ -139,12 +168,11 @@ namespace Flax.Deps.Dependencies
|
|||||||
|
|
||||||
// Build for Linux
|
// Build for Linux
|
||||||
SetupDirectory(buildDir, true);
|
SetupDirectory(buildDir, true);
|
||||||
var toolchain = UnixToolchain.GetToolchainName(platform, TargetArchitecture.x64);
|
var toolchain = UnixToolchain.GetToolchainName(platform, architecture);
|
||||||
Utilities.Run("cmake", string.Format("-G \"Unix Makefiles\" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DFT_WITH_BZIP2=OFF -DFT_WITH_ZLIB=OFF -DFT_WITH_PNG=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_TARGET={0} ..", toolchain), null, buildDir, Utilities.RunOptions.ThrowExceptionOnError, envVars);
|
Utilities.Run("cmake", string.Format("-G \"Unix Makefiles\" -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DFT_WITH_BZIP2=OFF -DFT_WITH_ZLIB=OFF -DFT_WITH_PNG=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_TARGET={0} ..", toolchain), null, buildDir, Utilities.RunOptions.ThrowExceptionOnError, envVars);
|
||||||
Utilities.Run("cmake", "--build .", null, buildDir, Utilities.RunOptions.ThrowExceptionOnError, envVars);
|
Utilities.Run("cmake", "--build .", null, buildDir, Utilities.RunOptions.ThrowExceptionOnError, envVars);
|
||||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||||
Utilities.FileCopy(Path.Combine(buildDir, libraryFileName), Path.Combine(depsFolder, libraryFileName));
|
Utilities.FileCopy(Path.Combine(buildDir, libraryFileName), Path.Combine(depsFolder, libraryFileName));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TargetPlatform.PS4:
|
case TargetPlatform.PS4:
|
||||||
@@ -211,7 +239,7 @@ namespace Flax.Deps.Dependencies
|
|||||||
|
|
||||||
// Build for Android
|
// Build for Android
|
||||||
SetupDirectory(buildDir, true);
|
SetupDirectory(buildDir, true);
|
||||||
RunCmake(buildDir, TargetPlatform.Android, TargetArchitecture.ARM64, ".. -DFT_WITH_BZIP2=OFF -DFT_WITH_ZLIB=OFF -DFT_WITH_PNG=OFF -DCMAKE_BUILD_TYPE=Release");
|
RunCmake(buildDir, TargetPlatform.Android, TargetArchitecture.ARM64, ".. -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DFT_WITH_BZIP2=OFF -DFT_WITH_ZLIB=OFF -DFT_WITH_PNG=OFF -DCMAKE_BUILD_TYPE=Release");
|
||||||
BuildCmake(buildDir);
|
BuildCmake(buildDir);
|
||||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.ARM64);
|
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.ARM64);
|
||||||
Utilities.FileCopy(Path.Combine(buildDir, libraryFileName), Path.Combine(depsFolder, libraryFileName));
|
Utilities.FileCopy(Path.Combine(buildDir, libraryFileName), Path.Combine(depsFolder, libraryFileName));
|
||||||
@@ -221,7 +249,7 @@ namespace Flax.Deps.Dependencies
|
|||||||
{
|
{
|
||||||
// Build for Switch
|
// Build for Switch
|
||||||
SetupDirectory(buildDir, true);
|
SetupDirectory(buildDir, true);
|
||||||
RunCmake(buildDir, platform, TargetArchitecture.ARM64, ".. -DCMAKE_BUILD_TYPE=Release");
|
RunCmake(buildDir, platform, TargetArchitecture.ARM64, ".. -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release");
|
||||||
BuildCmake(buildDir);
|
BuildCmake(buildDir);
|
||||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.ARM64);
|
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.ARM64);
|
||||||
Utilities.FileCopy(Path.Combine(buildDir, libraryFileName), Path.Combine(depsFolder, libraryFileName));
|
Utilities.FileCopy(Path.Combine(buildDir, libraryFileName), Path.Combine(depsFolder, libraryFileName));
|
||||||
@@ -230,14 +258,11 @@ namespace Flax.Deps.Dependencies
|
|||||||
case TargetPlatform.Mac:
|
case TargetPlatform.Mac:
|
||||||
{
|
{
|
||||||
// Build for Mac
|
// Build for Mac
|
||||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
|
||||||
{
|
|
||||||
SetupDirectory(buildDir, true);
|
SetupDirectory(buildDir, true);
|
||||||
RunCmake(buildDir, platform, architecture, ".. -DCMAKE_BUILD_TYPE=Release");
|
RunCmake(buildDir, platform, architecture, ".. -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release");
|
||||||
BuildCmake(buildDir);
|
BuildCmake(buildDir);
|
||||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||||
Utilities.FileCopy(Path.Combine(buildDir, libraryFileName), Path.Combine(depsFolder, libraryFileName));
|
Utilities.FileCopy(Path.Combine(buildDir, libraryFileName), Path.Combine(depsFolder, libraryFileName));
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TargetPlatform.iOS:
|
case TargetPlatform.iOS:
|
||||||
@@ -250,7 +275,7 @@ namespace Flax.Deps.Dependencies
|
|||||||
|
|
||||||
// Build for iOS
|
// Build for iOS
|
||||||
SetupDirectory(buildDir, true);
|
SetupDirectory(buildDir, true);
|
||||||
RunCmake(buildDir, platform, TargetArchitecture.ARM64, ".. -DIOS_PLATFORM=OS -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_BUILD_TYPE=Release -DFT_WITH_BZIP2=OFF -DFT_WITH_ZLIB=OFF -DFT_WITH_PNG=OFF");
|
RunCmake(buildDir, platform, TargetArchitecture.ARM64, ".. -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DIOS_PLATFORM=OS -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_BUILD_TYPE=Release -DFT_WITH_BZIP2=OFF -DFT_WITH_ZLIB=OFF -DFT_WITH_PNG=OFF");
|
||||||
BuildCmake(buildDir);
|
BuildCmake(buildDir);
|
||||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.ARM64);
|
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.ARM64);
|
||||||
Utilities.FileCopy(Path.Combine(buildDir, libraryFileName), Path.Combine(depsFolder, libraryFileName));
|
Utilities.FileCopy(Path.Combine(buildDir, libraryFileName), Path.Combine(depsFolder, libraryFileName));
|
||||||
@@ -258,6 +283,7 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Backup files
|
// Backup files
|
||||||
var srcIncludePath = Path.Combine(root, "include", "freetype");
|
var srcIncludePath = Path.Combine(root, "include", "freetype");
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
// Copyright (c) Wojciech Figat. All rights reserved.
|
// Copyright (c) Wojciech Figat. All rights reserved.
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Flax.Build;
|
using Flax.Build;
|
||||||
|
|
||||||
@@ -38,13 +39,43 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override TargetArchitecture[] Architectures
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch (BuildPlatform)
|
||||||
|
{
|
||||||
|
case TargetPlatform.Windows:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
case TargetPlatform.Linux:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
//TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
case TargetPlatform.Mac:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
default: return new TargetArchitecture[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void Build(BuildOptions options)
|
public override void Build(BuildOptions options)
|
||||||
{
|
{
|
||||||
var root = options.IntermediateFolder;
|
var root = options.IntermediateFolder;
|
||||||
var installDir = Path.Combine(root, "install");
|
var installDir = Path.Combine(root, "install");
|
||||||
var configuration = "Release";
|
var configuration = "Release";
|
||||||
var cmakeArgs = string.Format("-DCMAKE_INSTALL_PREFIX=\"{0}\" -DCMAKE_BUILD_TYPE={1} -DENABLE_RTTI=ON -DENABLE_CTEST=OFF -DENABLE_HLSL=ON -DENABLE_SPVREMAPPER=ON -DENABLE_GLSLANG_BINARIES=OFF", installDir, configuration);
|
var cmakeArgs = $"-DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_INSTALL_PREFIX=\"{installDir}\" -DCMAKE_BUILD_TYPE={configuration} -DENABLE_RTTI=ON -DENABLE_CTEST=OFF -DENABLE_HLSL=ON -DENABLE_SPVREMAPPER=ON -DENABLE_GLSLANG_BINARIES=OFF";
|
||||||
var libsRoot = Path.Combine(installDir, "lib");
|
var libsRoot = Path.Combine(installDir, "lib");
|
||||||
|
|
||||||
// Get the source
|
// Get the source
|
||||||
@@ -52,11 +83,16 @@ namespace Flax.Deps.Dependencies
|
|||||||
|
|
||||||
// Setup the external sources
|
// Setup the external sources
|
||||||
// Requires distutils (pip install setuptools)
|
// Requires distutils (pip install setuptools)
|
||||||
Utilities.Run("python", "update_glslang_sources.py", null, root, Utilities.RunOptions.ConsoleLogOutput);
|
if (Utilities.Run(BuildPlatform != TargetPlatform.Mac ? "python" : "python3", "update_glslang_sources.py", null, root, Utilities.RunOptions.ConsoleLogOutput) != 0)
|
||||||
|
throw new Exception("Failed to update glslang sources, make sure setuptools python package is installed.");
|
||||||
|
|
||||||
foreach (var platform in options.Platforms)
|
foreach (var platform in options.Platforms)
|
||||||
{
|
{
|
||||||
BuildStarted(platform);
|
foreach (var architecture in options.Architectures)
|
||||||
|
{
|
||||||
|
BuildStarted(platform, architecture);
|
||||||
|
|
||||||
|
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
||||||
switch (platform)
|
switch (platform)
|
||||||
{
|
{
|
||||||
case TargetPlatform.Windows:
|
case TargetPlatform.Windows:
|
||||||
@@ -75,21 +111,16 @@ namespace Flax.Deps.Dependencies
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Build for Windows
|
// Build for Windows
|
||||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
|
||||||
{
|
|
||||||
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
|
||||||
var solutionPath = Path.Combine(buildDir, "glslang.sln");
|
var solutionPath = Path.Combine(buildDir, "glslang.sln");
|
||||||
|
|
||||||
SetupDirectory(buildDir, false);
|
SetupDirectory(buildDir, false);
|
||||||
RunCmake(root, platform, architecture, cmakeArgs + $" -B\"{buildDir}\"");
|
RunCmake(root, platform, architecture, $"-B\"{buildDir}\" " + cmakeArgs);
|
||||||
Utilities.Run("cmake", string.Format("--build . --config {0} --target install", configuration), null, buildDir, Utilities.RunOptions.ConsoleLogOutput);
|
|
||||||
Deploy.VCEnvironment.BuildSolution(solutionPath, configuration, architecture.ToString());
|
Deploy.VCEnvironment.BuildSolution(solutionPath, configuration, architecture.ToString());
|
||||||
|
Utilities.Run("cmake", $"--build \"{buildDir}\" --config {configuration} --target install", null, buildDir, Utilities.RunOptions.ConsoleLogOutput);
|
||||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||||
foreach (var file in outputFiles)
|
foreach (var file in outputFiles)
|
||||||
{
|
{
|
||||||
Utilities.FileCopy(file, Path.Combine(depsFolder, Path.GetFileName(file)));
|
Utilities.FileCopy(file, Path.Combine(depsFolder, Path.GetFileName(file)));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TargetPlatform.Linux:
|
case TargetPlatform.Linux:
|
||||||
@@ -106,13 +137,12 @@ namespace Flax.Deps.Dependencies
|
|||||||
Path.Combine(libsRoot, "libSPIRV.a"),
|
Path.Combine(libsRoot, "libSPIRV.a"),
|
||||||
Path.Combine(libsRoot, "libglslang.a"),
|
Path.Combine(libsRoot, "libglslang.a"),
|
||||||
};
|
};
|
||||||
var buildDir = root;
|
|
||||||
|
|
||||||
// Build for Linux
|
// Build for Linux
|
||||||
RunCmake(root, platform, TargetArchitecture.x64, cmakeArgs);
|
RunCmake(root, platform, architecture, $"-B\"{buildDir}\" " + cmakeArgs);
|
||||||
Utilities.Run("cmake", string.Format("--build . --config {0} --target install", configuration), null, buildDir, Utilities.RunOptions.ConsoleLogOutput);
|
Utilities.Run("make", null, null, buildDir, Utilities.RunOptions.ConsoleLogOutput);
|
||||||
Utilities.Run("make", null, null, root, Utilities.RunOptions.ConsoleLogOutput);
|
Utilities.Run("cmake", $"--build \"{buildDir}\" --config {configuration} --target install", null, buildDir, Utilities.RunOptions.ConsoleLogOutput);
|
||||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||||
foreach (var file in outputFiles)
|
foreach (var file in outputFiles)
|
||||||
{
|
{
|
||||||
var dst = Path.Combine(depsFolder, Path.GetFileName(file));
|
var dst = Path.Combine(depsFolder, Path.GetFileName(file));
|
||||||
@@ -135,14 +165,11 @@ namespace Flax.Deps.Dependencies
|
|||||||
Path.Combine(libsRoot, "libSPIRV.a"),
|
Path.Combine(libsRoot, "libSPIRV.a"),
|
||||||
Path.Combine(libsRoot, "libglslang.a"),
|
Path.Combine(libsRoot, "libglslang.a"),
|
||||||
};
|
};
|
||||||
var buildDir = root;
|
|
||||||
|
|
||||||
// Build for Mac
|
// Build for Mac
|
||||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
RunCmake(root, platform, architecture, $"-B\"{buildDir}\" " + cmakeArgs);
|
||||||
{
|
Utilities.Run("make", null, null, buildDir, Utilities.RunOptions.ConsoleLogOutput);
|
||||||
RunCmake(root, platform, architecture, cmakeArgs);
|
Utilities.Run("cmake", $"--build \"{buildDir}\" --config {configuration} --target install", null, buildDir, Utilities.RunOptions.ConsoleLogOutput);
|
||||||
Utilities.Run("cmake", string.Format("--build . --config {0} --target install", configuration), null, buildDir, Utilities.RunOptions.ConsoleLogOutput);
|
|
||||||
Utilities.Run("make", null, null, root, Utilities.RunOptions.ConsoleLogOutput);
|
|
||||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||||
foreach (var file in outputFiles)
|
foreach (var file in outputFiles)
|
||||||
{
|
{
|
||||||
@@ -150,11 +177,11 @@ namespace Flax.Deps.Dependencies
|
|||||||
Utilities.FileCopy(file, dst);
|
Utilities.FileCopy(file, dst);
|
||||||
Utilities.Run("strip", string.Format("\"{0}\"", dst), null, null, Utilities.RunOptions.ConsoleLogOutput);
|
Utilities.Run("strip", string.Format("\"{0}\"", dst), null, null, Utilities.RunOptions.ConsoleLogOutput);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Copy glslang headers
|
// Copy glslang headers
|
||||||
foreach (var dir in new[]
|
foreach (var dir in new[]
|
||||||
|
|||||||
@@ -29,6 +29,24 @@ class libportal : Dependency
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override TargetArchitecture[] Architectures
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch (BuildPlatform)
|
||||||
|
{
|
||||||
|
case TargetPlatform.Linux:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
//TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
default: return new TargetArchitecture[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void Build(BuildOptions options)
|
public override void Build(BuildOptions options)
|
||||||
{
|
{
|
||||||
@@ -56,12 +74,12 @@ class libportal : Dependency
|
|||||||
|
|
||||||
foreach (var platform in options.Platforms)
|
foreach (var platform in options.Platforms)
|
||||||
{
|
{
|
||||||
BuildStarted(platform);
|
foreach (var architecture in options.Architectures)
|
||||||
|
{
|
||||||
|
BuildStarted(platform, architecture);
|
||||||
switch (platform)
|
switch (platform)
|
||||||
{
|
{
|
||||||
case TargetPlatform.Linux:
|
case TargetPlatform.Linux:
|
||||||
{
|
|
||||||
foreach (var architecture in new TargetArchitecture[] { TargetArchitecture.x64 /*, TargetArchitecture.ARM64*/ })
|
|
||||||
{
|
{
|
||||||
var buildDir = $"build_{architecture}";
|
var buildDir = $"build_{architecture}";
|
||||||
Utilities.Run("meson", $"{buildDir} {string.Join(" ", configs)}", null, root, Utilities.RunOptions.DefaultTool);
|
Utilities.Run("meson", $"{buildDir} {string.Join(" ", configs)}", null, root, Utilities.RunOptions.DefaultTool);
|
||||||
@@ -71,7 +89,6 @@ class libportal : Dependency
|
|||||||
Utilities.FileCopy(Path.Combine(root, buildDir, "libportal", "libportal.a"), Path.Combine(depsFolder, "libportal.a"));
|
Utilities.FileCopy(Path.Combine(root, buildDir, "libportal", "libportal.a"), Path.Combine(depsFolder, "libportal.a"));
|
||||||
Utilities.FileCopy(Path.Combine(root, buildDir, "libportal", "portal-enums.h"), Path.Combine(includePath, "portal-enums.h"));
|
Utilities.FileCopy(Path.Combine(root, buildDir, "libportal", "portal-enums.h"), Path.Combine(includePath, "portal-enums.h"));
|
||||||
Utilities.FileCopy(Path.Combine(root, buildDir, "libportal", "portal-enums.c"), Path.Combine(dstPath, "portal-enums.c"));
|
Utilities.FileCopy(Path.Combine(root, buildDir, "libportal", "portal-enums.c"), Path.Combine(dstPath, "portal-enums.c"));
|
||||||
}
|
|
||||||
|
|
||||||
Utilities.FileCopy(Path.Combine(root, "COPYING"), Path.Combine(dstPath, "LICENSE.txt"));
|
Utilities.FileCopy(Path.Combine(root, "COPYING"), Path.Combine(dstPath, "LICENSE.txt"));
|
||||||
|
|
||||||
@@ -88,3 +105,4 @@ class libportal : Dependency
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -53,6 +53,36 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override TargetArchitecture[] Architectures
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch (BuildPlatform)
|
||||||
|
{
|
||||||
|
case TargetPlatform.Windows:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
case TargetPlatform.Linux:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
//TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
case TargetPlatform.Mac:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
default: return new TargetArchitecture[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private string root;
|
private string root;
|
||||||
private string monoPropsPath;
|
private string monoPropsPath;
|
||||||
private string monoPreprocesorDefines;
|
private string monoPreprocesorDefines;
|
||||||
|
|||||||
@@ -43,6 +43,39 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override TargetArchitecture[] Architectures
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch (BuildPlatform)
|
||||||
|
{
|
||||||
|
case TargetPlatform.Windows:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
case TargetPlatform.Linux:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
//TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
case TargetPlatform.Mac:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
default: return new TargetArchitecture[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override bool BuildByDefault => false;
|
||||||
|
|
||||||
private string root;
|
private string root;
|
||||||
private bool cleanArtifacts;
|
private bool cleanArtifacts;
|
||||||
|
|
||||||
@@ -331,7 +364,9 @@ namespace Flax.Deps.Dependencies
|
|||||||
|
|
||||||
foreach (var platform in options.Platforms)
|
foreach (var platform in options.Platforms)
|
||||||
{
|
{
|
||||||
BuildStarted(platform);
|
foreach (var architecture in options.Architectures)
|
||||||
|
{
|
||||||
|
BuildStarted(platform, architecture);
|
||||||
var platformData = Path.Combine(GetBinariesFolder(options, platform), "Data", "nethost");
|
var platformData = Path.Combine(GetBinariesFolder(options, platform), "Data", "nethost");
|
||||||
if (Directory.Exists(platformData))
|
if (Directory.Exists(platformData))
|
||||||
Utilities.DirectoryCopy(platformData, root, true, true);
|
Utilities.DirectoryCopy(platformData, root, true, true);
|
||||||
@@ -351,6 +386,7 @@ namespace Flax.Deps.Dependencies
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Copy license
|
// Copy license
|
||||||
var dstIncludePath = Path.Combine(options.ThirdPartyFolder, "nethost");
|
var dstIncludePath = Path.Combine(options.ThirdPartyFolder, "nethost");
|
||||||
|
|||||||
@@ -18,6 +18,23 @@ namespace Flax.Deps.Dependencies
|
|||||||
get => new[] { TargetPlatform.Windows };
|
get => new[] { TargetPlatform.Windows };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override TargetArchitecture[] Architectures
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch (BuildPlatform)
|
||||||
|
{
|
||||||
|
case TargetPlatform.Windows:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64
|
||||||
|
};
|
||||||
|
default: return new TargetArchitecture[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void Build(BuildOptions options)
|
public override void Build(BuildOptions options)
|
||||||
{
|
{
|
||||||
@@ -30,7 +47,7 @@ namespace Flax.Deps.Dependencies
|
|||||||
// Copy files
|
// Copy files
|
||||||
foreach (var platform in options.Platforms)
|
foreach (var platform in options.Platforms)
|
||||||
{
|
{
|
||||||
BuildStarted(platform);
|
BuildStarted(platform, TargetArchitecture.x64);
|
||||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
||||||
Utilities.FileCopy(Path.Combine(root, "amd64/nvapi64.lib"), Path.Combine(depsFolder, "nvapi64.lib"));
|
Utilities.FileCopy(Path.Combine(root, "amd64/nvapi64.lib"), Path.Combine(depsFolder, "nvapi64.lib"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,22 +49,54 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override TargetArchitecture[] Architectures
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
switch (BuildPlatform)
|
||||||
|
{
|
||||||
|
case TargetPlatform.Windows:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
case TargetPlatform.Linux:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
//TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
case TargetPlatform.Mac:
|
||||||
|
return new[]
|
||||||
|
{
|
||||||
|
TargetArchitecture.x64,
|
||||||
|
TargetArchitecture.ARM64,
|
||||||
|
};
|
||||||
|
default: return new TargetArchitecture[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private struct Binary
|
private struct Binary
|
||||||
{
|
{
|
||||||
public string Filename;
|
public string Filename;
|
||||||
public string SrcFolder;
|
public string SrcFolder;
|
||||||
|
public string DstFilename;
|
||||||
|
|
||||||
public Binary(string filename, string srcFolder)
|
public Binary(string filename, string srcFolder, string dstFilename = null)
|
||||||
{
|
{
|
||||||
Filename = filename;
|
Filename = filename;
|
||||||
SrcFolder = srcFolder;
|
SrcFolder = srcFolder;
|
||||||
|
DstFilename = dstFilename;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool hasSourcesReady;
|
private bool hasSourcesReady;
|
||||||
private string root;
|
private string root;
|
||||||
private string rootMsvcLib;
|
private string rootMsvcLib;
|
||||||
private string configurationMsvc;
|
private string _configuration = "Release";
|
||||||
private List<string> vcxprojContentsWindows;
|
private List<string> vcxprojContentsWindows;
|
||||||
private string[] vcxprojPathsWindows;
|
private string[] vcxprojPathsWindows;
|
||||||
|
|
||||||
@@ -74,22 +106,6 @@ namespace Flax.Deps.Dependencies
|
|||||||
new Binary("libvorbisfile_static.lib", "libvorbisfile"),
|
new Binary("libvorbisfile_static.lib", "libvorbisfile"),
|
||||||
};
|
};
|
||||||
|
|
||||||
private (string, string)[] vorbisBinariesToCopyWindowsCmake =
|
|
||||||
{
|
|
||||||
("vorbis.lib", "libvorbis_static.lib"),
|
|
||||||
("vorbisfile.lib", "libvorbisfile_static.lib"),
|
|
||||||
};
|
|
||||||
|
|
||||||
private Binary[] oggBinariesToCopyWindows =
|
|
||||||
{
|
|
||||||
new Binary("libogg_static.lib", "ogg"),
|
|
||||||
};
|
|
||||||
|
|
||||||
private (string, string)[] oggBinariesToCopyWindowsCmake =
|
|
||||||
{
|
|
||||||
("ogg.lib", "libogg_static.lib"),
|
|
||||||
};
|
|
||||||
|
|
||||||
private void PatchWindowsTargetPlatformVersion(string windowsTargetPlatformVersion, string platformToolset)
|
private void PatchWindowsTargetPlatformVersion(string windowsTargetPlatformVersion, string platformToolset)
|
||||||
{
|
{
|
||||||
// Fix the MSVC project settings for Windows
|
// Fix the MSVC project settings for Windows
|
||||||
@@ -107,7 +123,6 @@ namespace Flax.Deps.Dependencies
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
hasSourcesReady = true;
|
hasSourcesReady = true;
|
||||||
configurationMsvc = "Release";
|
|
||||||
|
|
||||||
string oggRoot = Path.Combine(root, "libogg");
|
string oggRoot = Path.Combine(root, "libogg");
|
||||||
string vorbisRoot = Path.Combine(root, "libvorbis");
|
string vorbisRoot = Path.Combine(root, "libvorbis");
|
||||||
@@ -197,7 +212,7 @@ namespace Flax.Deps.Dependencies
|
|||||||
break;
|
break;
|
||||||
default: throw new InvalidArchitectureException(architecture);
|
default: throw new InvalidArchitectureException(architecture);
|
||||||
}
|
}
|
||||||
binariesToCopy.AddRange(vorbisBinariesToCopyWindows.Select(x => new Binary(x.Filename, Path.Combine(buildDir, x.SrcFolder, buildPlatform, configurationMsvc))));
|
binariesToCopy.AddRange(vorbisBinariesToCopyWindows.Select(x => new Binary(x.Filename, Path.Combine(buildDir, x.SrcFolder, buildPlatform, _configuration))));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TargetPlatform.PS4:
|
case TargetPlatform.PS4:
|
||||||
@@ -216,7 +231,7 @@ namespace Flax.Deps.Dependencies
|
|||||||
buildDir, true, true);
|
buildDir, true, true);
|
||||||
Utilities.FileCopy(Path.Combine(GetBinariesFolder(options, platform), "Data", "ogg", "ogg", "config_types.h"),
|
Utilities.FileCopy(Path.Combine(GetBinariesFolder(options, platform), "Data", "ogg", "ogg", "config_types.h"),
|
||||||
Path.Combine(root, "libogg", "include", "ogg", "config_types.h"));
|
Path.Combine(root, "libogg", "include", "ogg", "config_types.h"));
|
||||||
binariesToCopy.AddRange(binariesToCopyVorbis.Select(x => new Binary(x.Filename, Path.Combine(buildDir, x.SrcFolder, buildPlatform, configurationMsvc))));
|
binariesToCopy.AddRange(binariesToCopyVorbis.Select(x => new Binary(x.Filename, Path.Combine(buildDir, x.SrcFolder, buildPlatform, _configuration))));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TargetPlatform.PS5:
|
case TargetPlatform.PS5:
|
||||||
@@ -237,7 +252,7 @@ namespace Flax.Deps.Dependencies
|
|||||||
Utilities.FileCopy(
|
Utilities.FileCopy(
|
||||||
Path.Combine(GetBinariesFolder(options, platform), "Data", "ogg", "ogg", "config_types.h"),
|
Path.Combine(GetBinariesFolder(options, platform), "Data", "ogg", "ogg", "config_types.h"),
|
||||||
Path.Combine(root, "libogg", "include", "ogg", "config_types.h"));
|
Path.Combine(root, "libogg", "include", "ogg", "config_types.h"));
|
||||||
binariesToCopy.AddRange(binariesToCopyVorbis.Select(x => new Binary(x.Filename, Path.Combine(buildDir, x.SrcFolder, buildPlatform, configurationMsvc))));
|
binariesToCopy.AddRange(binariesToCopyVorbis.Select(x => new Binary(x.Filename, Path.Combine(buildDir, x.SrcFolder, buildPlatform, _configuration))));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TargetPlatform.XboxOne:
|
case TargetPlatform.XboxOne:
|
||||||
@@ -245,21 +260,21 @@ namespace Flax.Deps.Dependencies
|
|||||||
vcxprojPaths = vcxprojPathsWindows;
|
vcxprojPaths = vcxprojPathsWindows;
|
||||||
buildPlatform = "x64";
|
buildPlatform = "x64";
|
||||||
PatchWindowsTargetPlatformVersion("10.0", "v143");
|
PatchWindowsTargetPlatformVersion("10.0", "v143");
|
||||||
binariesToCopy.AddRange(vorbisBinariesToCopyWindows.Select(x => new Binary(x.Filename, Path.Combine(buildDir, x.SrcFolder, buildPlatform, configurationMsvc))));
|
binariesToCopy.AddRange(vorbisBinariesToCopyWindows.Select(x => new Binary(x.Filename, Path.Combine(buildDir, x.SrcFolder, buildPlatform, _configuration))));
|
||||||
break;
|
break;
|
||||||
case TargetPlatform.XboxScarlett:
|
case TargetPlatform.XboxScarlett:
|
||||||
buildDir = Path.Combine(rootMsvcLib, "win32", "VS2010");
|
buildDir = Path.Combine(rootMsvcLib, "win32", "VS2010");
|
||||||
vcxprojPaths = vcxprojPathsWindows;
|
vcxprojPaths = vcxprojPathsWindows;
|
||||||
buildPlatform = "x64";
|
buildPlatform = "x64";
|
||||||
PatchWindowsTargetPlatformVersion("10.0", "v143");
|
PatchWindowsTargetPlatformVersion("10.0", "v143");
|
||||||
binariesToCopy.AddRange(vorbisBinariesToCopyWindows.Select(x => new Binary(x.Filename, Path.Combine(buildDir, x.SrcFolder, buildPlatform, configurationMsvc))));
|
binariesToCopy.AddRange(vorbisBinariesToCopyWindows.Select(x => new Binary(x.Filename, Path.Combine(buildDir, x.SrcFolder, buildPlatform, _configuration))));
|
||||||
break;
|
break;
|
||||||
default: throw new InvalidPlatformException(platform);
|
default: throw new InvalidPlatformException(platform);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build
|
// Build
|
||||||
foreach (var vcxprojPath in vcxprojPaths)
|
foreach (var vcxprojPath in vcxprojPaths)
|
||||||
Deploy.VCEnvironment.BuildSolution(vcxprojPath, configurationMsvc, buildPlatform);
|
Deploy.VCEnvironment.BuildSolution(vcxprojPath, _configuration, buildPlatform);
|
||||||
|
|
||||||
// Copy binaries
|
// Copy binaries
|
||||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||||
@@ -273,48 +288,107 @@ namespace Flax.Deps.Dependencies
|
|||||||
|
|
||||||
string oggRoot = Path.Combine(root, "libogg");
|
string oggRoot = Path.Combine(root, "libogg");
|
||||||
string vorbisRoot = Path.Combine(root, "libvorbis");
|
string vorbisRoot = Path.Combine(root, "libvorbis");
|
||||||
|
|
||||||
var oggBuildDir = Path.Combine(oggRoot, "build-" + architecture.ToString());
|
var oggBuildDir = Path.Combine(oggRoot, "build-" + architecture.ToString());
|
||||||
var vorbisBuildDir = Path.Combine(vorbisRoot, "build-" + architecture.ToString());
|
var vorbisBuildDir = Path.Combine(vorbisRoot, "build-" + architecture.ToString());
|
||||||
|
var installDir = Path.Combine(root, "install");
|
||||||
|
|
||||||
string ext;
|
string ext;
|
||||||
|
string oggConfig = $"-DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE={_configuration} -DCMAKE_INSTALL_PREFIX=\"{installDir}\"";
|
||||||
|
string vorbisConfig = $"-DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE={_configuration} -DCMAKE_INSTALL_PREFIX=\"{installDir}\"";
|
||||||
|
string liboggFilename = "libogg";
|
||||||
|
Dictionary<string, string> envVars = new Dictionary<string, string>();
|
||||||
|
(string, string)[] oggBinariesToCopy;
|
||||||
|
Binary[] vorbisBinariesToCopy;
|
||||||
switch (platform)
|
switch (platform)
|
||||||
{
|
{
|
||||||
case TargetPlatform.Windows:
|
case TargetPlatform.Windows:
|
||||||
case TargetPlatform.UWP:
|
case TargetPlatform.UWP:
|
||||||
case TargetPlatform.XboxOne:
|
case TargetPlatform.XboxOne:
|
||||||
|
oggConfig += " -DBUILD_SHARED_LIBS=OFF";
|
||||||
|
vorbisConfig += " -DBUILD_SHARED_LIBS=OFF";
|
||||||
ext = ".lib";
|
ext = ".lib";
|
||||||
|
liboggFilename = "ogg";
|
||||||
break;
|
break;
|
||||||
case TargetPlatform.Linux:
|
case TargetPlatform.Linux:
|
||||||
|
oggConfig += " -DCMAKE_POSITION_INDEPENDENT_CODE=ON";
|
||||||
|
vorbisConfig += " -DCMAKE_POSITION_INDEPENDENT_CODE=ON";
|
||||||
|
envVars = new Dictionary<string, string>
|
||||||
|
{
|
||||||
|
{ "CC", "clang-" + Configuration.LinuxClangMinVer },
|
||||||
|
{ "CC_FOR_BUILD", "clang-" + Configuration.LinuxClangMinVer }
|
||||||
|
};
|
||||||
|
ext = ".a";
|
||||||
|
break;
|
||||||
|
case TargetPlatform.Mac:
|
||||||
|
//oggConfig += $" -DOGG_INCLUDE_DIR=\"{oggRoot}/install/include\" -DOGG_LIBRARY=\"{oggRoot}/install/lib\"";
|
||||||
ext = ".a";
|
ext = ".a";
|
||||||
break;
|
break;
|
||||||
default: throw new InvalidPlatformException(platform);
|
default: throw new InvalidPlatformException(platform);
|
||||||
}
|
}
|
||||||
|
|
||||||
var binariesToCopy = new List<(string, string)>();
|
switch (platform)
|
||||||
|
|
||||||
// Build ogg
|
|
||||||
{
|
{
|
||||||
var solutionPath = Path.Combine(oggBuildDir, "ogg.sln");
|
case TargetPlatform.Windows:
|
||||||
|
case TargetPlatform.UWP:
|
||||||
RunCmake(oggRoot, platform, architecture, $"-B\"{oggBuildDir}\" -DBUILD_SHARED_LIBS=OFF");
|
case TargetPlatform.XboxOne:
|
||||||
Deploy.VCEnvironment.BuildSolution(solutionPath, configurationMsvc, architecture.ToString());
|
oggBinariesToCopy =
|
||||||
foreach (var file in oggBinariesToCopyWindowsCmake)
|
[
|
||||||
binariesToCopy.Add((Path.Combine(oggBuildDir, configurationMsvc, file.Item1), file.Item2));
|
("ogg.lib", "libogg_static.lib")
|
||||||
|
];
|
||||||
|
vorbisBinariesToCopy =
|
||||||
|
[
|
||||||
|
new Binary("vorbis.lib", "libvorbis", "libvorbis_static.lib"),
|
||||||
|
new Binary("vorbisfile.lib", "libvorbisfile", "libvorbisfile_static.lib")
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
case TargetPlatform.Linux:
|
||||||
|
case TargetPlatform.Mac:
|
||||||
|
oggBinariesToCopy =
|
||||||
|
[
|
||||||
|
("libogg.a", "libogg.a")
|
||||||
|
];
|
||||||
|
vorbisBinariesToCopy =
|
||||||
|
[
|
||||||
|
new Binary("libvorbis.a", "lib"),
|
||||||
|
new Binary("libvorbisenc.a", "lib"),
|
||||||
|
new Binary("libvorbisfile.a", "lib")
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
default: throw new InvalidPlatformException(platform);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vorbisConfig += $" -DOGG_INCLUDE_DIR=\"{Path.Combine(installDir, "include")}\" -DOGG_LIBRARY=\"{Path.Combine(installDir, "lib", liboggFilename + ext)}\"";
|
||||||
|
|
||||||
|
var binariesToCopy = new List<(string, string)>();
|
||||||
|
|
||||||
|
SetupDirectory(installDir, true);
|
||||||
|
// Build ogg
|
||||||
|
{
|
||||||
|
SetupDirectory(oggBuildDir, true);
|
||||||
|
RunCmake(oggRoot, platform, architecture, $"-B\"{oggBuildDir}\" " + oggConfig, envVars);
|
||||||
|
if (platform == TargetPlatform.Windows)
|
||||||
|
Deploy.VCEnvironment.BuildSolution(Path.Combine(oggBuildDir, "ogg.sln"), _configuration, architecture.ToString());
|
||||||
|
else
|
||||||
|
BuildCmake(oggBuildDir);
|
||||||
|
Utilities.Run("cmake", $"--build . --config {_configuration} --target install", null, oggBuildDir, Utilities.RunOptions.DefaultTool);
|
||||||
|
}
|
||||||
// Build vorbis
|
// Build vorbis
|
||||||
{
|
{
|
||||||
var oggLibraryPath = Path.Combine(oggBuildDir, configurationMsvc, "ogg" + ext);
|
SetupDirectory(vorbisBuildDir, true);
|
||||||
var solutionPath = Path.Combine(vorbisBuildDir, "vorbis.sln");
|
RunCmake(vorbisRoot, platform, architecture, $"-B\"{vorbisBuildDir}\" " + vorbisConfig);
|
||||||
|
if (platform == TargetPlatform.Windows)
|
||||||
RunCmake(vorbisRoot, platform, architecture, $"-B\"{vorbisBuildDir}\" -DOGG_INCLUDE_DIR=\"{Path.Combine(oggRoot, "include")}\" -DOGG_LIBRARY=\"{oggLibraryPath}\" -DBUILD_SHARED_LIBS=OFF");
|
Deploy.VCEnvironment.BuildSolution(Path.Combine(vorbisBuildDir, "vorbis.sln"), _configuration, architecture.ToString());
|
||||||
Deploy.VCEnvironment.BuildSolution(solutionPath, configurationMsvc, architecture.ToString());
|
else
|
||||||
foreach (var file in vorbisBinariesToCopyWindowsCmake)
|
BuildCmake(vorbisBuildDir);
|
||||||
binariesToCopy.Add((Path.Combine(vorbisBuildDir, "lib", configurationMsvc, file.Item1), file.Item2));
|
Utilities.Run("cmake", $"--build . --config {_configuration} --target install", null, vorbisBuildDir, Utilities.RunOptions.DefaultTool);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy binaries
|
// Copy binaries
|
||||||
|
foreach (var file in oggBinariesToCopy)
|
||||||
|
binariesToCopy.Add((Path.Combine(installDir, "lib", file.Item1), file.Item2));
|
||||||
|
foreach (var file in vorbisBinariesToCopy)
|
||||||
|
binariesToCopy.Add((Path.Combine(installDir, "lib", file.Filename), file.DstFilename ?? file.Filename));
|
||||||
|
|
||||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||||
foreach (var file in binariesToCopy)
|
foreach (var file in binariesToCopy)
|
||||||
Utilities.FileCopy(file.Item1, Path.Combine(depsFolder, file.Item2));
|
Utilities.FileCopy(file.Item1, Path.Combine(depsFolder, file.Item2));
|
||||||
@@ -337,50 +411,29 @@ namespace Flax.Deps.Dependencies
|
|||||||
|
|
||||||
foreach (var platform in options.Platforms)
|
foreach (var platform in options.Platforms)
|
||||||
{
|
{
|
||||||
BuildStarted(platform);
|
foreach (var architecture in options.Architectures)
|
||||||
|
{
|
||||||
|
BuildStarted(platform, architecture);
|
||||||
switch (platform)
|
switch (platform)
|
||||||
{
|
{
|
||||||
case TargetPlatform.Windows:
|
case TargetPlatform.Windows:
|
||||||
{
|
{
|
||||||
BuildCmake(options, TargetPlatform.Windows, TargetArchitecture.x64);
|
BuildCmake(options, TargetPlatform.Windows, architecture);
|
||||||
BuildCmake(options, TargetPlatform.Windows, TargetArchitecture.ARM64);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TargetPlatform.UWP:
|
case TargetPlatform.UWP:
|
||||||
{
|
{
|
||||||
BuildMsbuild(options, TargetPlatform.UWP, TargetArchitecture.x64);
|
BuildMsbuild(options, TargetPlatform.UWP, architecture);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TargetPlatform.XboxOne:
|
case TargetPlatform.XboxOne:
|
||||||
{
|
{
|
||||||
BuildMsbuild(options, TargetPlatform.XboxOne, TargetArchitecture.x64);
|
BuildMsbuild(options, TargetPlatform.XboxOne, architecture);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TargetPlatform.Linux:
|
case TargetPlatform.Linux:
|
||||||
{
|
{
|
||||||
// Note: assumes the libogg-dev package is pre-installed on the system
|
BuildCmake(options, TargetPlatform.Linux, architecture);
|
||||||
|
|
||||||
// Get the source
|
|
||||||
CloneGitRepoFast(root, "https://github.com/xiph/vorbis.git");
|
|
||||||
|
|
||||||
var envVars = new Dictionary<string, string>
|
|
||||||
{
|
|
||||||
{ "CC", "clang-" + Configuration.LinuxClangMinVer },
|
|
||||||
{ "CC_FOR_BUILD", "clang-" + Configuration.LinuxClangMinVer }
|
|
||||||
};
|
|
||||||
var buildDir = Path.Combine(root, "build");
|
|
||||||
|
|
||||||
Utilities.Run(Path.Combine(root, "autogen.sh"), null, null, root, Utilities.RunOptions.Default, envVars);
|
|
||||||
|
|
||||||
// Build for Linux
|
|
||||||
var toolchain = UnixToolchain.GetToolchainName(platform, TargetArchitecture.x64);
|
|
||||||
Utilities.Run(Path.Combine(root, "configure"), string.Format("--host={0}", toolchain), null, root, Utilities.RunOptions.Default, envVars);
|
|
||||||
SetupDirectory(buildDir, true);
|
|
||||||
Utilities.Run("cmake", "-G \"Unix Makefiles\" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release ..", null, buildDir, Utilities.RunOptions.ConsoleLogOutput, envVars);
|
|
||||||
Utilities.Run("cmake", "--build .", null, buildDir, Utilities.RunOptions.ConsoleLogOutput, envVars);
|
|
||||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
|
||||||
foreach (var file in binariesToCopyUnix)
|
|
||||||
Utilities.FileCopy(Path.Combine(buildDir, file.SrcFolder, file.Filename), Path.Combine(depsFolder, file.Filename));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TargetPlatform.PS4:
|
case TargetPlatform.PS4:
|
||||||
@@ -412,7 +465,7 @@ namespace Flax.Deps.Dependencies
|
|||||||
// Build for Android
|
// Build for Android
|
||||||
SetupDirectory(oggBuildDir, true);
|
SetupDirectory(oggBuildDir, true);
|
||||||
RunCmake(oggBuildDir, platform, TargetArchitecture.ARM64, ".. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=\"../install\"");
|
RunCmake(oggBuildDir, platform, TargetArchitecture.ARM64, ".. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=\"../install\"");
|
||||||
Utilities.Run("cmake", "--build . --target install", null, oggBuildDir, Utilities.RunOptions.ConsoleLogOutput);
|
Utilities.Run("cmake", "--build . --config Release --target install", null, oggBuildDir, Utilities.RunOptions.ConsoleLogOutput);
|
||||||
SetupDirectory(buildDir, true);
|
SetupDirectory(buildDir, true);
|
||||||
RunCmake(buildDir, platform, TargetArchitecture.ARM64, string.Format(".. -DCMAKE_BUILD_TYPE=Release -DOGG_INCLUDE_DIR=\"{0}/install/include\" -DOGG_LIBRARY=\"{0}/install/lib\"", oggRoot));
|
RunCmake(buildDir, platform, TargetArchitecture.ARM64, string.Format(".. -DCMAKE_BUILD_TYPE=Release -DOGG_INCLUDE_DIR=\"{0}/install/include\" -DOGG_LIBRARY=\"{0}/install/lib\"", oggRoot));
|
||||||
BuildCmake(buildDir);
|
BuildCmake(buildDir);
|
||||||
@@ -439,7 +492,7 @@ namespace Flax.Deps.Dependencies
|
|||||||
// Build for Switch
|
// Build for Switch
|
||||||
SetupDirectory(oggBuildDir, true);
|
SetupDirectory(oggBuildDir, true);
|
||||||
RunCmake(oggBuildDir, platform, TargetArchitecture.ARM64, ".. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=\"../install\"");
|
RunCmake(oggBuildDir, platform, TargetArchitecture.ARM64, ".. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=\"../install\"");
|
||||||
Utilities.Run("cmake", "--build . --target install", null, oggBuildDir, Utilities.RunOptions.ConsoleLogOutput);
|
Utilities.Run("cmake", "--build . --config Release --target install", null, oggBuildDir, Utilities.RunOptions.ConsoleLogOutput);
|
||||||
Utilities.FileCopy(Path.Combine(GetBinariesFolder(options, platform), "Data/ogg", "include", "ogg", "config_types.h"), Path.Combine(oggRoot, "install", "include", "ogg", "config_types.h"));
|
Utilities.FileCopy(Path.Combine(GetBinariesFolder(options, platform), "Data/ogg", "include", "ogg", "config_types.h"), Path.Combine(oggRoot, "install", "include", "ogg", "config_types.h"));
|
||||||
SetupDirectory(buildDir, true);
|
SetupDirectory(buildDir, true);
|
||||||
RunCmake(buildDir, platform, TargetArchitecture.ARM64, string.Format(".. -DCMAKE_BUILD_TYPE=Release -DOGG_INCLUDE_DIR=\"{0}/install/include\" -DOGG_LIBRARY=\"{0}/install/lib\"", oggRoot));
|
RunCmake(buildDir, platform, TargetArchitecture.ARM64, string.Format(".. -DCMAKE_BUILD_TYPE=Release -DOGG_INCLUDE_DIR=\"{0}/install/include\" -DOGG_LIBRARY=\"{0}/install/lib\"", oggRoot));
|
||||||
@@ -451,28 +504,7 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
case TargetPlatform.Mac:
|
case TargetPlatform.Mac:
|
||||||
{
|
{
|
||||||
var oggRoot = Path.Combine(root, "ogg");
|
BuildCmake(options, TargetPlatform.Mac, architecture);
|
||||||
var oggBuildDir = Path.Combine(oggRoot, "build");
|
|
||||||
var buildDir = Path.Combine(root, "build");
|
|
||||||
|
|
||||||
// Get the source
|
|
||||||
CloneGitRepoFast(root, "https://github.com/xiph/vorbis.git");
|
|
||||||
CloneGitRepo(oggRoot, "https://github.com/xiph/ogg.git");
|
|
||||||
GitCheckout(oggRoot, "master", "4380566a44b8d5e85ad511c9c17eb04197863ec5");
|
|
||||||
|
|
||||||
// Build for Mac
|
|
||||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
|
||||||
{
|
|
||||||
SetupDirectory(oggBuildDir, true);
|
|
||||||
RunCmake(oggBuildDir, platform, architecture, ".. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=\"../install\"");
|
|
||||||
Utilities.Run("cmake", "--build . --target install", null, oggBuildDir, Utilities.RunOptions.ConsoleLogOutput);
|
|
||||||
SetupDirectory(buildDir, true);
|
|
||||||
RunCmake(buildDir, platform, architecture, string.Format(".. -DCMAKE_BUILD_TYPE=Release -DOGG_INCLUDE_DIR=\"{0}/install/include\" -DOGG_LIBRARY=\"{0}/install/lib\"", oggRoot));
|
|
||||||
BuildCmake(buildDir);
|
|
||||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
|
||||||
foreach (var file in binariesToCopyUnix)
|
|
||||||
Utilities.FileCopy(Path.Combine(buildDir, file.SrcFolder, file.Filename), Path.Combine(depsFolder, file.Filename));
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TargetPlatform.iOS:
|
case TargetPlatform.iOS:
|
||||||
@@ -489,7 +521,7 @@ namespace Flax.Deps.Dependencies
|
|||||||
// Build for Mac
|
// Build for Mac
|
||||||
SetupDirectory(oggBuildDir, true);
|
SetupDirectory(oggBuildDir, true);
|
||||||
RunCmake(oggBuildDir, platform, TargetArchitecture.ARM64, ".. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=\"../install\"");
|
RunCmake(oggBuildDir, platform, TargetArchitecture.ARM64, ".. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=\"../install\"");
|
||||||
Utilities.Run("cmake", "--build . --target install", null, oggBuildDir, Utilities.RunOptions.ConsoleLogOutput);
|
Utilities.Run("cmake", "--build . --config Release --target install", null, oggBuildDir, Utilities.RunOptions.ConsoleLogOutput);
|
||||||
SetupDirectory(buildDir, true);
|
SetupDirectory(buildDir, true);
|
||||||
RunCmake(buildDir, platform, TargetArchitecture.ARM64, string.Format(".. -DCMAKE_BUILD_TYPE=Release -DOGG_INCLUDE_DIR=\"{0}/install/include\" -DOGG_LIBRARY=\"{0}/install/lib\"", oggRoot));
|
RunCmake(buildDir, platform, TargetArchitecture.ARM64, string.Format(".. -DCMAKE_BUILD_TYPE=Release -DOGG_INCLUDE_DIR=\"{0}/install/include\" -DOGG_LIBRARY=\"{0}/install/lib\"", oggRoot));
|
||||||
BuildCmake(buildDir);
|
BuildCmake(buildDir);
|
||||||
@@ -500,38 +532,19 @@ namespace Flax.Deps.Dependencies
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Backup files
|
|
||||||
if (hasSourcesReady)
|
|
||||||
root = rootMsvcLib;
|
|
||||||
var srcIncludePath = Path.Combine(root, "include", "vorbis");
|
|
||||||
var dstIncludePath = Path.Combine(options.ThirdPartyFolder, "vorbis");
|
|
||||||
foreach (var filename in filesToKeep)
|
|
||||||
{
|
|
||||||
var src = Path.Combine(dstIncludePath, filename);
|
|
||||||
var dst = Path.Combine(options.IntermediateFolder, filename + ".tmp");
|
|
||||||
Utilities.FileCopy(src, dst);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// Setup headers directory
|
// Setup headers directory
|
||||||
SetupDirectory(dstIncludePath, true);
|
var installDir = Path.Combine(root, "install");
|
||||||
|
var oggOut = Path.Combine(options.ThirdPartyFolder, "ogg");
|
||||||
|
var vorbisOut = Path.Combine(options.ThirdPartyFolder, "vorbis");
|
||||||
|
|
||||||
// Deploy header files and restore files
|
// Deploy header files
|
||||||
Directory.GetFiles(srcIncludePath, "Makefile*").ToList().ForEach(File.Delete);
|
Utilities.DirectoryCopy(Path.Combine(installDir, "include", "ogg"), oggOut, true, true);
|
||||||
Utilities.DirectoryCopy(srcIncludePath, dstIncludePath, true, true);
|
Utilities.DirectoryCopy(Path.Combine(installDir, "include", "vorbis"), vorbisOut, true, true);
|
||||||
Utilities.FileCopy(Path.Combine(root, "COPYING"), Path.Combine(dstIncludePath, "COPYING"));
|
|
||||||
}
|
Utilities.FileCopy(Path.Combine(root, "libogg", "COPYING"), Path.Combine(oggOut, "COPYING"));
|
||||||
finally
|
Utilities.FileCopy(Path.Combine(root, "libvorbis", "COPYING"), Path.Combine(vorbisOut, "COPYING"));
|
||||||
{
|
|
||||||
foreach (var filename in filesToKeep)
|
|
||||||
{
|
|
||||||
var src = Path.Combine(options.IntermediateFolder, filename + ".tmp");
|
|
||||||
var dst = Path.Combine(dstIncludePath, filename);
|
|
||||||
Utilities.FileCopy(src, dst);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,11 @@ namespace Flax.Deps
|
|||||||
/// The target platforms to build dependency for (contains only platforms supported by the dependency itself).
|
/// The target platforms to build dependency for (contains only platforms supported by the dependency itself).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public TargetPlatform[] Platforms;
|
public TargetPlatform[] Platforms;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The target architectures to build dependency for (contains only platforms supported by the dependency itself).
|
||||||
|
/// </summary>
|
||||||
|
public TargetArchitecture[] Architectures;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -47,11 +52,34 @@ namespace Flax.Deps
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected static TargetPlatform BuildPlatform => Platform.BuildPlatform.Target;
|
protected static TargetPlatform BuildPlatform => Platform.BuildPlatform.Target;
|
||||||
|
|
||||||
|
|
||||||
|
private static Version? _cmakeVersion;
|
||||||
|
protected static Version CMakeVersion
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_cmakeVersion == null)
|
||||||
|
{
|
||||||
|
var versionOutput = Utilities.ReadProcessOutput("cmake", "--version");
|
||||||
|
var versionStart = versionOutput.IndexOf("cmake version ") + "cmake version ".Length;
|
||||||
|
var versionEnd = versionOutput.IndexOfAny(['-', '\n', '\r'], versionStart); // End of line or dash before Git hash
|
||||||
|
var versionString = versionOutput.Substring(versionStart, versionEnd - versionStart);
|
||||||
|
_cmakeVersion = new Version(versionString);
|
||||||
|
}
|
||||||
|
return _cmakeVersion;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the platforms list supported by this dependency to build on the current build platform (based on <see cref="Platform.BuildPlatform"/>).
|
/// Gets the platforms list supported by this dependency to build on the current build platform (based on <see cref="Platform.BuildPlatform"/>).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract TargetPlatform[] Platforms { get; }
|
public abstract TargetPlatform[] Platforms { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the architectures list supported by this dependency to build on the current build platform (based on <see cref="Platform.BuildPlatform"/>).
|
||||||
|
/// </summary>
|
||||||
|
public abstract TargetArchitecture[] Architectures { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// True if build dependency by default, otherwise only when explicitly specified via command line.
|
/// True if build dependency by default, otherwise only when explicitly specified via command line.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -67,9 +95,9 @@ namespace Flax.Deps
|
|||||||
/// Logs build process start.
|
/// Logs build process start.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="platform">Target platform.</param>
|
/// <param name="platform">Target platform.</param>
|
||||||
protected void BuildStarted(TargetPlatform platform)
|
protected void BuildStarted(TargetPlatform platform, TargetArchitecture architecture)
|
||||||
{
|
{
|
||||||
Log.Info($"Building {GetType().Name} for {platform}");
|
Log.Info($"Building {GetType().Name} for {platform}{(architecture != TargetArchitecture.AnyCPU ? $" ({architecture})" : "")}");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -351,6 +379,12 @@ namespace Flax.Deps
|
|||||||
break;
|
break;
|
||||||
default: throw new InvalidArchitectureException(architecture);
|
default: throw new InvalidArchitectureException(architecture);
|
||||||
}
|
}
|
||||||
|
if (CMakeVersion.Major > 4 || (CMakeVersion.Major == 4 && CMakeVersion.Minor >= 2))
|
||||||
|
{
|
||||||
|
// This generates both .sln and .slnx solution files
|
||||||
|
cmdLine = string.Format("CMakeLists.txt -G \"Visual Studio 17 2022\" -G \"Visual Studio 18 2026\" -A {0}", arch);
|
||||||
|
}
|
||||||
|
else
|
||||||
cmdLine = string.Format("CMakeLists.txt -G \"Visual Studio 17 2022\" -A {0}", arch);
|
cmdLine = string.Format("CMakeLists.txt -G \"Visual Studio 17 2022\" -A {0}", arch);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,20 +38,21 @@ namespace Flax.Deps
|
|||||||
var platforms = Globals.AllPlatforms;
|
var platforms = Globals.AllPlatforms;
|
||||||
if (Configuration.BuildPlatforms != null && Configuration.BuildPlatforms.Length != 0)
|
if (Configuration.BuildPlatforms != null && Configuration.BuildPlatforms.Length != 0)
|
||||||
platforms = Configuration.BuildPlatforms;
|
platforms = Configuration.BuildPlatforms;
|
||||||
platforms = platforms.Where(x => buildPlatform.CanBuildPlatform(x)).ToArray();
|
platforms = platforms.Where(buildPlatform.CanBuildPlatform).ToArray();
|
||||||
Log.Verbose("Building deps for platforms:");
|
var architectures = Globals.AllArchitectures;
|
||||||
|
if (Configuration.BuildArchitectures != null && Configuration.BuildArchitectures.Length != 0)
|
||||||
|
architectures = Configuration.BuildArchitectures;
|
||||||
|
architectures = architectures.Where(buildPlatform.CanBuildArchitecture).ToArray();
|
||||||
|
Log.Verbose($"Building deps for platforms {string.Join(',', platforms)}, {string.Join(',', architectures)}:");
|
||||||
foreach (var platform in platforms)
|
foreach (var platform in platforms)
|
||||||
{
|
{
|
||||||
Log.Verbose(" - " + platform);
|
foreach (var architecture in architectures)
|
||||||
|
{
|
||||||
|
Log.Verbose($" - {platform} ({architecture})");
|
||||||
|
|
||||||
if (Platform.IsPlatformSupported(platform, TargetArchitecture.x64))
|
if (Platform.IsPlatformSupported(platform, architecture))
|
||||||
SetupDepsOutputFolder(options, platform, TargetArchitecture.x64);
|
SetupDepsOutputFolder(options, platform, architecture);
|
||||||
if (Platform.IsPlatformSupported(platform, TargetArchitecture.x86))
|
}
|
||||||
SetupDepsOutputFolder(options, platform, TargetArchitecture.x86);
|
|
||||||
if (Platform.IsPlatformSupported(platform, TargetArchitecture.ARM))
|
|
||||||
SetupDepsOutputFolder(options, platform, TargetArchitecture.ARM);
|
|
||||||
if (Platform.IsPlatformSupported(platform, TargetArchitecture.ARM64))
|
|
||||||
SetupDepsOutputFolder(options, platform, TargetArchitecture.ARM64);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get all deps
|
// Get all deps
|
||||||
@@ -80,6 +81,14 @@ namespace Flax.Deps
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
options.Architectures = architectures.Intersect(dependency.Architectures).ToArray();
|
||||||
|
if (options.Architectures.Length == 0)
|
||||||
|
{
|
||||||
|
Log.Info(string.Format("Skipping {0} ({1}/{2})", name, i + 1, dependencies.Length));
|
||||||
|
Log.Verbose("Architecture not used on any of the build platforms.");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
Log.Info(string.Format("Building {0} ({1}/{2})", name, i + 1, dependencies.Length));
|
Log.Info(string.Format("Building {0} ({1}/{2})", name, i + 1, dependencies.Length));
|
||||||
|
|
||||||
options.IntermediateFolder = Path.Combine(Environment.CurrentDirectory, "Cache", "Intermediate", "Deps", name).Replace('\\', '/');
|
options.IntermediateFolder = Path.Combine(Environment.CurrentDirectory, "Cache", "Intermediate", "Deps", name).Replace('\\', '/');
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace Flax.Build
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Specifies the minimum CPU architecture type to support (on x86/x64).
|
/// Specifies the minimum CPU architecture type to support (on x86/x64).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[CommandLine("winCpuArch", "<arch>", "Specifies the minimum CPU architecture type to support (om x86/x64).")]
|
[CommandLine("winCpuArch", "<arch>", "Specifies the minimum CPU architecture type to support (on x86/x64).")]
|
||||||
public static CpuArchitecture WindowsCpuArch = CpuArchitecture.AVX2; // 94.48% support on PC according to Steam Hardware & Software Survey: May 2025 (https://store.steampowered.com/hwsurvey/)
|
public static CpuArchitecture WindowsCpuArch = CpuArchitecture.AVX2; // 94.48% support on PC according to Steam Hardware & Software Survey: May 2025 (https://store.steampowered.com/hwsurvey/)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -76,13 +76,10 @@ namespace Flax.Build.Platforms
|
|||||||
options.LinkEnv.InputLibraries.Add("oleaut32.lib");
|
options.LinkEnv.InputLibraries.Add("oleaut32.lib");
|
||||||
options.LinkEnv.InputLibraries.Add("delayimp.lib");
|
options.LinkEnv.InputLibraries.Add("delayimp.lib");
|
||||||
|
|
||||||
if (options.Architecture == TargetArchitecture.ARM64)
|
|
||||||
{
|
|
||||||
options.CompileEnv.PreprocessorDefinitions.Add("USE_SOFT_INTRINSICS");
|
|
||||||
options.LinkEnv.InputLibraries.Add("softintrin.lib");
|
|
||||||
}
|
|
||||||
|
|
||||||
options.CompileEnv.CpuArchitecture = Configuration.WindowsCpuArch;
|
options.CompileEnv.CpuArchitecture = Configuration.WindowsCpuArch;
|
||||||
|
|
||||||
|
if (options.Architecture == TargetArchitecture.x64)
|
||||||
|
{
|
||||||
if (_minVersion.Major <= 7 && options.CompileEnv.CpuArchitecture == CpuArchitecture.AVX2)
|
if (_minVersion.Major <= 7 && options.CompileEnv.CpuArchitecture == CpuArchitecture.AVX2)
|
||||||
{
|
{
|
||||||
// Old Windows had lower support ratio for latest CPU features
|
// Old Windows had lower support ratio for latest CPU features
|
||||||
@@ -94,6 +91,14 @@ namespace Flax.Build.Platforms
|
|||||||
options.CompileEnv.CpuArchitecture = CpuArchitecture.SSE4_2;
|
options.CompileEnv.CpuArchitecture = CpuArchitecture.SSE4_2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (options.Architecture == TargetArchitecture.ARM64)
|
||||||
|
{
|
||||||
|
options.CompileEnv.PreprocessorDefinitions.Add("USE_SOFT_INTRINSICS");
|
||||||
|
options.LinkEnv.InputLibraries.Add("softintrin.lib");
|
||||||
|
if (options.CompileEnv.CpuArchitecture != CpuArchitecture.None)
|
||||||
|
options.CompileEnv.CpuArchitecture = CpuArchitecture.NEON;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override void SetupCompileCppFilesArgs(TaskGraph graph, BuildOptions options, List<string> args)
|
protected override void SetupCompileCppFilesArgs(TaskGraph graph, BuildOptions options, List<string> args)
|
||||||
|
|||||||
Reference in New Issue
Block a user