Add support for building dependencies with specific architecture
This commit is contained in:
@@ -18,6 +18,24 @@ namespace Flax.Deps.Dependencies
|
||||
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 />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
@@ -30,7 +48,7 @@ namespace Flax.Deps.Dependencies
|
||||
// Copy files
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
BuildStarted(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.dll"), Path.Combine(depsFolder, "amd_ags_x64.dll"));
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Flax.Build;
|
||||
|
||||
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 />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
@@ -91,7 +122,9 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
BuildStarted(platform, architecture);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
@@ -105,8 +138,6 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
// Build for Windows
|
||||
File.Delete(Path.Combine(root, "CMakeCache.txt"));
|
||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
{
|
||||
var buildDir = Path.Combine(root, "build-" + architecture);
|
||||
var solutionPath = Path.Combine(buildDir, "Assimp.sln");
|
||||
SetupDirectory(buildDir, true);
|
||||
@@ -116,8 +147,6 @@ namespace Flax.Deps.Dependencies
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
foreach (var file in binariesWin)
|
||||
Utilities.FileCopy(Path.Combine(buildDir, file), Path.Combine(depsFolder, Path.GetFileName(file)));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Linux:
|
||||
@@ -127,32 +156,31 @@ namespace Flax.Deps.Dependencies
|
||||
{ "CC", "clang-" + Configuration.LinuxClangMinVer },
|
||||
{ "CC_FOR_BUILD", "clang-" + Configuration.LinuxClangMinVer },
|
||||
{ "CXX", "clang++-" + Configuration.LinuxClangMinVer },
|
||||
{ "CMAKE_BUILD_PARALLEL_LEVEL", CmakeBuildParallel },
|
||||
};
|
||||
|
||||
// Build for Linux
|
||||
RunCmake(root, platform, TargetArchitecture.x64, " -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF " + globalConfig, envVars);
|
||||
RunCmake(root, platform, architecture, " -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF " + globalConfig, envVars);
|
||||
Utilities.Run("make", null, null, root, Utilities.RunOptions.ThrowExceptionOnError, envVars);
|
||||
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"));
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Mac:
|
||||
{
|
||||
// Build for Mac
|
||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
{
|
||||
RunCmake(root, platform, architecture, " -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF " + globalConfig);
|
||||
Utilities.Run("make", null, null, root, Utilities.RunOptions.ThrowExceptionOnError);
|
||||
configHeaderFilePath = Path.Combine(root, "include", "assimp", "config.h");
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
Utilities.FileCopy(Path.Combine(root, "lib", "libassimp.a"), Path.Combine(depsFolder, "libassimp.a"));
|
||||
Utilities.Run("make", "clean", null, root, Utilities.RunOptions.ThrowExceptionOnError);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Deploy header files and license (preserve module build rules file)
|
||||
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 />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
@@ -46,12 +64,12 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
BuildStarted(platform, architecture);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
{
|
||||
Deploy.VCEnvironment.BuildSolution(solutionPath, configuration, architecture.ToString());
|
||||
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 />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
BuildStarted(platform, architecture);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
@@ -45,8 +65,6 @@ namespace Flax.Deps.Dependencies
|
||||
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());
|
||||
|
||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
{
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
|
||||
string dxilLocation = @$"{binLocation}\{architecture}\dxil.dll";
|
||||
@@ -60,7 +78,6 @@ namespace Flax.Deps.Dependencies
|
||||
string d3dcompilerLibLocation = @$"{sdkLibLocation}\{architecture}\d3dcompiler.lib";
|
||||
Utilities.FileCopy(dxcompilerLibLocation, Path.Combine(depsFolder, Path.GetFileName(dxcompilerLibLocation)));
|
||||
Utilities.FileCopy(d3dcompilerLibLocation, Path.Combine(depsFolder, "d3dcompiler_47.lib"));
|
||||
}
|
||||
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 />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
@@ -47,20 +65,19 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
BuildStarted(platform, architecture);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
var solutionPath = Path.Combine(root, "DirectXTex_Desktop_2022_Win10.sln");
|
||||
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());
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
foreach (var file in outputFileNames)
|
||||
Utilities.FileCopy(Path.Combine(binFolder, architecture.ToString(), configuration, file), Path.Combine(depsFolder, file));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.UWP:
|
||||
@@ -68,7 +85,7 @@ namespace Flax.Deps.Dependencies
|
||||
var solutionPath = Path.Combine(root, "DirectXTex_Windows10_2019.sln");
|
||||
var binFolder = Path.Combine(root, "DirectXTex", "Bin", "Windows10_2019");
|
||||
Deploy.VCEnvironment.BuildSolution(solutionPath, configuration, "x64");
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
foreach (var file in outputFileNames)
|
||||
Utilities.FileCopy(Path.Combine(binFolder, "x64", configuration, file), Path.Combine(depsFolder, file));
|
||||
break;
|
||||
@@ -87,6 +104,7 @@ namespace Flax.Deps.Dependencies
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Deploy header files and license file
|
||||
var dstIncludePath = Path.Combine(options.ThirdPartyFolder, "DirectXTex");
|
||||
|
||||
@@ -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 />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
|
||||
@@ -50,6 +50,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 />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
@@ -61,12 +91,13 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
BuildStarted(platform, architecture);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
Build(options, platform, TargetArchitecture.x64);
|
||||
Build(options, platform, TargetArchitecture.ARM64);
|
||||
Build(options, platform, architecture);
|
||||
break;
|
||||
case TargetPlatform.XboxOne:
|
||||
case TargetPlatform.XboxScarlett:
|
||||
@@ -85,17 +116,17 @@ namespace Flax.Deps.Dependencies
|
||||
Build(options, platform, TargetArchitecture.ARM64);
|
||||
break;
|
||||
case TargetPlatform.Mac:
|
||||
Build(options, platform, TargetArchitecture.x64);
|
||||
Build(options, platform, TargetArchitecture.ARM64);
|
||||
Build(options, platform, architecture);
|
||||
break;
|
||||
case TargetPlatform.iOS:
|
||||
Build(options, platform, TargetArchitecture.ARM64);
|
||||
break;
|
||||
case TargetPlatform.Linux:
|
||||
Build(options, platform, TargetArchitecture.x64);
|
||||
Build(options, platform, architecture);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Copy header files
|
||||
var dstIncludePath = Path.Combine(options.ThirdPartyFolder, "NvCloth");
|
||||
|
||||
@@ -45,6 +45,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 />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
@@ -54,9 +84,44 @@ namespace Flax.Deps.Dependencies
|
||||
var cmakeArgs = "-DCMAKE_POLICY_VERSION_MINIMUM=3.5";
|
||||
var dstIncludePath = Path.Combine(options.ThirdPartyFolder, "OpenAL");
|
||||
|
||||
if (options.Platforms.Contains(TargetPlatform.Windows))
|
||||
{
|
||||
// Get the source
|
||||
CloneGitRepo(root, "https://github.com/kcat/openal-soft.git");
|
||||
GitCheckout(root, "master", "d3875f333fb6abe2f39d82caca329414871ae53b"); // 1.23.1
|
||||
}
|
||||
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);
|
||||
using (ZipArchive archive = ZipFile.Open(packagePath, ZipArchiveMode.Read))
|
||||
{
|
||||
if (!Directory.Exists(root))
|
||||
archive.ExtractToDirectory(root);
|
||||
root = Path.Combine(root, archive.Entries.First().FullName);
|
||||
}
|
||||
}
|
||||
/*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);
|
||||
}*/
|
||||
}
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
BuildStarted(platform, architecture);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
@@ -67,13 +132,7 @@ namespace Flax.Deps.Dependencies
|
||||
"OpenAL32.dll",
|
||||
};
|
||||
|
||||
// Get the source
|
||||
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 })
|
||||
{
|
||||
// Build for Windows
|
||||
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
||||
var solutionPath = Path.Combine(buildDir, "OpenAL.sln");
|
||||
|
||||
@@ -82,7 +141,6 @@ namespace Flax.Deps.Dependencies
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
foreach (var file in binariesToCopy)
|
||||
Utilities.FileCopy(Path.Combine(buildDir, configuration, file), Path.Combine(depsFolder, Path.GetFileName(file)));
|
||||
}
|
||||
|
||||
#if false
|
||||
// Get the binaries
|
||||
@@ -134,12 +192,6 @@ namespace Flax.Deps.Dependencies
|
||||
$"-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);
|
||||
Utilities.Run("tar", "xjf " + packagePath.Replace('\\', '/'), null, root, Utilities.RunOptions.ConsoleLogOutput);
|
||||
|
||||
// Use separate build directory
|
||||
root = Path.Combine(root, "openal-soft-" + version);
|
||||
var buildDir = Path.Combine(root, "build");
|
||||
@@ -165,21 +217,6 @@ namespace Flax.Deps.Dependencies
|
||||
};
|
||||
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);
|
||||
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
|
||||
root = Path.Combine(root, "openal-soft-" + version);
|
||||
var buildDir = Path.Combine(root, "build");
|
||||
@@ -205,26 +242,17 @@ namespace Flax.Deps.Dependencies
|
||||
};
|
||||
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);
|
||||
Utilities.Run("tar", "xjf " + packagePath.Replace('\\', '/'), null, root, Utilities.RunOptions.ConsoleLogOutput);
|
||||
|
||||
// Use separate build directory
|
||||
root = Path.Combine(root, "openal-soft-" + version);
|
||||
var buildDir = Path.Combine(root, "build");
|
||||
|
||||
// Build for Mac
|
||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
{
|
||||
SetupDirectory(buildDir, true);
|
||||
RunCmake(buildDir, platform, architecture, ".. -DLIBTYPE=STATIC -DCMAKE_BUILD_TYPE=" + configuration + config, envVars);
|
||||
BuildCmake(buildDir, envVars);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
foreach (var file in binariesToCopy)
|
||||
Utilities.FileCopy(Path.Combine(buildDir, file), Path.Combine(depsFolder, file));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.iOS:
|
||||
@@ -239,14 +267,6 @@ namespace Flax.Deps.Dependencies
|
||||
};
|
||||
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);
|
||||
Utilities.Run("tar", "xjf " + packagePath.Replace('\\', '/'), null, root, Utilities.RunOptions.ConsoleLogOutput);
|
||||
}
|
||||
|
||||
// Use separate build directory
|
||||
root = Path.Combine(root, "openal-soft-" + version);
|
||||
var buildDir = Path.Combine(root, "build");
|
||||
@@ -265,3 +285,4 @@ namespace Flax.Deps.Dependencies
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 projectGenDir;
|
||||
private string projectGenPath;
|
||||
@@ -374,27 +404,32 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
BuildStarted(platform, architecture);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
if (architecture == TargetArchitecture.x64 || architecture == TargetArchitecture.ARM64)
|
||||
{
|
||||
try
|
||||
{
|
||||
Build(options, "vc18win64", platform, architecture);
|
||||
Build(options, "vc18win-arm64", platform, architecture);
|
||||
Build(options, architecture == TargetArchitecture.x64 ? "vc18win64" : "vc18win-arm64", platform, architecture);
|
||||
}
|
||||
catch
|
||||
{
|
||||
Log.Verbose("Failed to generate VS2026 solution for PhysX, fallback to VS2022");
|
||||
Build(options, "vc17win64", platform, architecture);
|
||||
Build(options, "vc17win-arm64", platform, architecture);
|
||||
Build(options, architecture == TargetArchitecture.x64 ? "vc17win64" : "vc17win-arm64", platform, architecture);
|
||||
}
|
||||
}
|
||||
else
|
||||
throw new InvalidArchitectureException(architecture);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Linux:
|
||||
{
|
||||
Build(options, "linux", platform, TargetArchitecture.x64);
|
||||
Build(options, "linux", platform, architecture);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.PS4:
|
||||
@@ -428,8 +463,12 @@ namespace Flax.Deps.Dependencies
|
||||
}
|
||||
case TargetPlatform.Mac:
|
||||
{
|
||||
Build(options, "mac64", platform, TargetArchitecture.x64);
|
||||
Build(options, "mac-arm64", platform, TargetArchitecture.ARM64);
|
||||
if (architecture == TargetArchitecture.x64)
|
||||
Build(options, "mac64", platform, architecture);
|
||||
else if (architecture == TargetArchitecture.ARM64)
|
||||
Build(options, "mac-arm64", platform, architecture);
|
||||
else
|
||||
throw new InvalidArchitectureException(architecture);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.iOS:
|
||||
@@ -439,6 +478,7 @@ namespace Flax.Deps.Dependencies
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Copy header files
|
||||
var dstIncludePath = Path.Combine(options.ThirdPartyFolder, "PhysX");
|
||||
|
||||
@@ -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 />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
@@ -94,12 +124,12 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
BuildStarted(platform, architecture);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
foreach (var architecture in new TargetArchitecture[] { TargetArchitecture.x64/*, TargetArchitecture.ARM64*/ })
|
||||
{
|
||||
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
||||
|
||||
@@ -120,13 +150,11 @@ namespace Flax.Deps.Dependencies
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
foreach (var file in binariesToCopy)
|
||||
Utilities.FileCopy(Path.Combine(buildDir, configuration, file), Path.Combine(depsFolder, file == "SDL3-static.lib" ? "SDL3.lib" : file));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Linux:
|
||||
case TargetPlatform.Mac:
|
||||
{
|
||||
foreach (var architecture in new [] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
{
|
||||
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
||||
|
||||
@@ -146,11 +174,11 @@ namespace Flax.Deps.Dependencies
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
foreach (var file in binariesToCopy)
|
||||
Utilities.FileCopy(Path.Combine(buildDir, file), Path.Combine(depsFolder, file));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Backup files
|
||||
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 />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
@@ -47,25 +77,25 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
BuildStarted(platform, architecture);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
// Build for Win64
|
||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
{
|
||||
// Build for Windows
|
||||
Deploy.VCEnvironment.BuildSolution(solutionPath, configuration, architecture.ToString(), new Dictionary<string, string>() { { "RestorePackagesConfig", "true" } });
|
||||
var depsFolder = GetThirdPartyFolder(options, TargetPlatform.Windows, architecture);
|
||||
foreach (var file in outputFileNames)
|
||||
{
|
||||
Utilities.FileCopy(Path.Combine(binFolder, architecture.ToString(), "Release", file), Path.Combine(depsFolder, file));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Deploy header files and license file
|
||||
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 />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
@@ -38,7 +56,7 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
BuildStarted(platform, TargetArchitecture.AnyCPU);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Linux:
|
||||
|
||||
@@ -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 />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
@@ -45,12 +69,12 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
BuildStarted(platform, architecture);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
|
||||
foreach (var architecture in new []{ TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
{
|
||||
string buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
||||
var isa = architecture == TargetArchitecture.ARM64 ? "-DASTCENC_ISA_NEON=ON" : "-DASTCENC_ISA_SSE2=ON";
|
||||
@@ -63,7 +87,6 @@ namespace Flax.Deps.Dependencies
|
||||
}
|
||||
break;
|
||||
case TargetPlatform.Mac:
|
||||
foreach (var architecture in new []{ TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
{
|
||||
string buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
||||
var isa = architecture == TargetArchitecture.ARM64 ? "-DASTCENC_ISA_NEON=ON" : "-DASTCENC_ISA_SSE2=ON";
|
||||
@@ -77,6 +100,7 @@ namespace Flax.Deps.Dependencies
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Copy header and license
|
||||
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 />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
@@ -69,14 +99,14 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
BuildStarted(platform, architecture);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
// Build for Win64 and ARM64
|
||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
{
|
||||
// Build for Windows
|
||||
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
||||
var solutionPath = Path.Combine(buildDir, "CURL.sln");
|
||||
|
||||
@@ -85,7 +115,6 @@ namespace Flax.Deps.Dependencies
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
foreach (var file in binariesToCopyWin)
|
||||
Utilities.FileCopy(Path.Combine(buildDir, "lib", configuration, file), Path.Combine(depsFolder, Path.GetFileName(file)));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Linux:
|
||||
@@ -133,8 +162,7 @@ namespace Flax.Deps.Dependencies
|
||||
"--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",
|
||||
};
|
||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
{
|
||||
|
||||
var arch = GetAppleArchName(architecture);
|
||||
var archName = arch + "-apple-darwin19";
|
||||
if (architecture == TargetArchitecture.ARM64)
|
||||
@@ -161,11 +189,11 @@ namespace Flax.Deps.Dependencies
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
var filename = "libcurl.a";
|
||||
Utilities.FileCopy(Path.Combine(buildDir, "lib", filename), Path.Combine(depsFolder, filename));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Backup files
|
||||
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 />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
BuildStarted(platform, architecture);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
var sdk = WindowsPlatformBase.GetSDKs().Last();
|
||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
{
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
var libLocation = @$"{sdk.Value}Debuggers\lib\{architecture}\dbghelp.lib";
|
||||
var dllLocation = @$"{sdk.Value}Debuggers\{architecture}\dbghelp.dll";
|
||||
Utilities.FileCopy(libLocation, Path.Combine(depsFolder, Path.GetFileName(libLocation)));
|
||||
Utilities.FileCopy(dllLocation, Path.Combine(depsFolder, Path.GetFileName(dllLocation)));
|
||||
}
|
||||
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 />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
@@ -94,7 +124,9 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
BuildStarted(platform, architecture);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
@@ -103,13 +135,10 @@ namespace Flax.Deps.Dependencies
|
||||
File.WriteAllText(vcxprojPath, vcxprojContents);
|
||||
|
||||
// Build for Windows
|
||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
{
|
||||
Deploy.VCEnvironment.BuildSolution(vsSolutionPath, configurationMsvc, architecture.ToString(), msvcProps);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
foreach (var filename in binariesToCopyMsvc)
|
||||
Utilities.FileCopy(Path.Combine(root, "objs", architecture.ToString(), configurationMsvc, filename), Path.Combine(depsFolder, filename));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Linux:
|
||||
@@ -139,12 +168,11 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
// Build for Linux
|
||||
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_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);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
Utilities.FileCopy(Path.Combine(buildDir, libraryFileName), Path.Combine(depsFolder, libraryFileName));
|
||||
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.PS4:
|
||||
@@ -230,14 +258,11 @@ namespace Flax.Deps.Dependencies
|
||||
case TargetPlatform.Mac:
|
||||
{
|
||||
// Build for Mac
|
||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
{
|
||||
SetupDirectory(buildDir, true);
|
||||
RunCmake(buildDir, platform, architecture, ".. -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release");
|
||||
BuildCmake(buildDir);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
Utilities.FileCopy(Path.Combine(buildDir, libraryFileName), Path.Combine(depsFolder, libraryFileName));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.iOS:
|
||||
@@ -258,6 +283,7 @@ namespace Flax.Deps.Dependencies
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Backup files
|
||||
var srcIncludePath = Path.Combine(root, "include", "freetype");
|
||||
|
||||
@@ -38,13 +38,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 />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
var root = options.IntermediateFolder;
|
||||
var installDir = Path.Combine(root, "install");
|
||||
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");
|
||||
|
||||
// Get the source
|
||||
@@ -56,7 +86,11 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
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)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
@@ -75,21 +109,16 @@ namespace Flax.Deps.Dependencies
|
||||
};
|
||||
|
||||
// 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");
|
||||
|
||||
SetupDirectory(buildDir, false);
|
||||
RunCmake(root, platform, architecture, cmakeArgs + $" -B\"{buildDir}\"");
|
||||
Utilities.Run("cmake", string.Format("--build . --config {0} --target install", configuration), null, buildDir, Utilities.RunOptions.ConsoleLogOutput);
|
||||
RunCmake(root, platform, architecture, $"-B\"{buildDir}\" " + cmakeArgs);
|
||||
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);
|
||||
foreach (var file in outputFiles)
|
||||
{
|
||||
Utilities.FileCopy(file, Path.Combine(depsFolder, Path.GetFileName(file)));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Linux:
|
||||
@@ -106,13 +135,12 @@ namespace Flax.Deps.Dependencies
|
||||
Path.Combine(libsRoot, "libSPIRV.a"),
|
||||
Path.Combine(libsRoot, "libglslang.a"),
|
||||
};
|
||||
var buildDir = root;
|
||||
|
||||
// Build for Linux
|
||||
RunCmake(root, platform, TargetArchitecture.x64, cmakeArgs);
|
||||
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, TargetArchitecture.x64);
|
||||
RunCmake(root, platform, architecture, $"-B\"{buildDir}\" " + cmakeArgs);
|
||||
Utilities.Run("make", null, null, buildDir, Utilities.RunOptions.ConsoleLogOutput);
|
||||
Utilities.Run("cmake", $"--build \"{buildDir}\" --config {configuration} --target install", null, buildDir, Utilities.RunOptions.ConsoleLogOutput);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
foreach (var file in outputFiles)
|
||||
{
|
||||
var dst = Path.Combine(depsFolder, Path.GetFileName(file));
|
||||
@@ -135,14 +163,11 @@ namespace Flax.Deps.Dependencies
|
||||
Path.Combine(libsRoot, "libSPIRV.a"),
|
||||
Path.Combine(libsRoot, "libglslang.a"),
|
||||
};
|
||||
var buildDir = root;
|
||||
|
||||
// Build for Mac
|
||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
{
|
||||
RunCmake(root, platform, architecture, cmakeArgs);
|
||||
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);
|
||||
RunCmake(root, platform, architecture, $"-B\"{buildDir}\" " + cmakeArgs);
|
||||
Utilities.Run("make", null, null, buildDir, Utilities.RunOptions.ConsoleLogOutput);
|
||||
Utilities.Run("cmake", $"--build \"{buildDir}\" --config {configuration} --target install", null, buildDir, Utilities.RunOptions.ConsoleLogOutput);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
foreach (var file in outputFiles)
|
||||
{
|
||||
@@ -150,11 +175,11 @@ namespace Flax.Deps.Dependencies
|
||||
Utilities.FileCopy(file, dst);
|
||||
Utilities.Run("strip", string.Format("\"{0}\"", dst), null, null, Utilities.RunOptions.ConsoleLogOutput);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Copy glslang headers
|
||||
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 />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
@@ -56,12 +74,12 @@ class libportal : Dependency
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
BuildStarted(platform, architecture);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Linux:
|
||||
{
|
||||
foreach (var architecture in new TargetArchitecture[] { TargetArchitecture.x64 /*, TargetArchitecture.ARM64*/ })
|
||||
{
|
||||
var buildDir = $"build_{architecture}";
|
||||
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", "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, "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 monoPropsPath;
|
||||
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 bool cleanArtifacts;
|
||||
|
||||
@@ -331,7 +364,9 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
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");
|
||||
if (Directory.Exists(platformData))
|
||||
Utilities.DirectoryCopy(platformData, root, true, true);
|
||||
@@ -351,6 +386,7 @@ namespace Flax.Deps.Dependencies
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Copy license
|
||||
var dstIncludePath = Path.Combine(options.ThirdPartyFolder, "nethost");
|
||||
|
||||
@@ -18,6 +18,23 @@ namespace Flax.Deps.Dependencies
|
||||
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 />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
@@ -30,7 +47,7 @@ namespace Flax.Deps.Dependencies
|
||||
// Copy files
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
BuildStarted(platform, TargetArchitecture.x64);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
||||
Utilities.FileCopy(Path.Combine(root, "amd64/nvapi64.lib"), Path.Combine(depsFolder, "nvapi64.lib"));
|
||||
}
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private struct Binary
|
||||
{
|
||||
public string Filename;
|
||||
@@ -337,23 +367,24 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
BuildStarted(platform, architecture);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
BuildCmake(options, TargetPlatform.Windows, TargetArchitecture.x64);
|
||||
BuildCmake(options, TargetPlatform.Windows, TargetArchitecture.ARM64);
|
||||
BuildCmake(options, TargetPlatform.Windows, architecture);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.UWP:
|
||||
{
|
||||
BuildMsbuild(options, TargetPlatform.UWP, TargetArchitecture.x64);
|
||||
BuildMsbuild(options, TargetPlatform.UWP, architecture);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.XboxOne:
|
||||
{
|
||||
BuildMsbuild(options, TargetPlatform.XboxOne, TargetArchitecture.x64);
|
||||
BuildMsbuild(options, TargetPlatform.XboxOne, architecture);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Linux:
|
||||
@@ -373,12 +404,12 @@ namespace Flax.Deps.Dependencies
|
||||
Utilities.Run(Path.Combine(root, "autogen.sh"), null, null, root, Utilities.RunOptions.Default, envVars);
|
||||
|
||||
// Build for Linux
|
||||
var toolchain = UnixToolchain.GetToolchainName(platform, TargetArchitecture.x64);
|
||||
var toolchain = UnixToolchain.GetToolchainName(platform, architecture);
|
||||
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);
|
||||
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;
|
||||
@@ -461,8 +492,6 @@ namespace Flax.Deps.Dependencies
|
||||
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);
|
||||
@@ -472,7 +501,6 @@ namespace Flax.Deps.Dependencies
|
||||
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;
|
||||
}
|
||||
case TargetPlatform.iOS:
|
||||
@@ -500,6 +528,7 @@ namespace Flax.Deps.Dependencies
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Backup files
|
||||
if (hasSourcesReady)
|
||||
|
||||
@@ -40,6 +40,11 @@ namespace Flax.Deps
|
||||
/// The target platforms to build dependency for (contains only platforms supported by the dependency itself).
|
||||
/// </summary>
|
||||
public TargetPlatform[] Platforms;
|
||||
|
||||
/// <summary>
|
||||
/// The target architectures to build dependency for (contains only platforms supported by the dependency itself).
|
||||
/// </summary>
|
||||
public TargetArchitecture[] Architectures;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -70,6 +75,11 @@ namespace Flax.Deps
|
||||
/// </summary>
|
||||
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>
|
||||
/// True if build dependency by default, otherwise only when explicitly specified via command line.
|
||||
/// </summary>
|
||||
@@ -85,9 +95,9 @@ namespace Flax.Deps
|
||||
/// Logs build process start.
|
||||
/// </summary>
|
||||
/// <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>
|
||||
|
||||
@@ -38,20 +38,21 @@ namespace Flax.Deps
|
||||
var platforms = Globals.AllPlatforms;
|
||||
if (Configuration.BuildPlatforms != null && Configuration.BuildPlatforms.Length != 0)
|
||||
platforms = Configuration.BuildPlatforms;
|
||||
platforms = platforms.Where(x => buildPlatform.CanBuildPlatform(x)).ToArray();
|
||||
Log.Verbose("Building deps for platforms:");
|
||||
platforms = platforms.Where(buildPlatform.CanBuildPlatform).ToArray();
|
||||
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)
|
||||
{
|
||||
Log.Verbose(" - " + platform);
|
||||
foreach (var architecture in architectures)
|
||||
{
|
||||
Log.Verbose($" - {platform} ({architecture})");
|
||||
|
||||
if (Platform.IsPlatformSupported(platform, TargetArchitecture.x64))
|
||||
SetupDepsOutputFolder(options, platform, TargetArchitecture.x64);
|
||||
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);
|
||||
if (Platform.IsPlatformSupported(platform, architecture))
|
||||
SetupDepsOutputFolder(options, platform, architecture);
|
||||
}
|
||||
}
|
||||
|
||||
// Get all deps
|
||||
@@ -80,6 +81,14 @@ namespace Flax.Deps
|
||||
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));
|
||||
|
||||
options.IntermediateFolder = Path.Combine(Environment.CurrentDirectory, "Cache", "Intermediate", "Deps", name).Replace('\\', '/');
|
||||
|
||||
Reference in New Issue
Block a user