Improve version parsing to share code
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
// Copyright (c) Wojciech Figat. All rights reserved.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Flax.Build.Graph;
|
||||
using Flax.Build.NativeCpp;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace Flax.Build
|
||||
{
|
||||
@@ -34,6 +35,10 @@ namespace Flax.Build.Platforms
|
||||
public LinuxToolchain(LinuxPlatform platform, TargetArchitecture architecture)
|
||||
: base(platform, architecture, platform.ToolchainRoot, platform.Compiler)
|
||||
{
|
||||
// Check version
|
||||
if (Utilities.ParseVersion(Configuration.LinuxClangMinVer, out var minClangVer) && ClangVersion < minClangVer)
|
||||
Log.Error($"Old Clang version {ClangVersion}. Minimum supported is {minClangVer}.");
|
||||
|
||||
// Setup system paths
|
||||
var includePath = Path.Combine(ToolsetRoot, "usr", "include");
|
||||
if (Directory.Exists(includePath))
|
||||
|
||||
@@ -44,13 +44,8 @@ namespace Flax.Build.Platforms
|
||||
: base(platform, architecture, WindowsPlatformToolset.Latest, WindowsPlatformSDK.Latest)
|
||||
{
|
||||
// Select minimum Windows version
|
||||
if (!Version.TryParse(Configuration.WindowsMinVer, out _minVersion))
|
||||
{
|
||||
if (int.TryParse(Configuration.WindowsMinVer, out var winMinVerMajor))
|
||||
_minVersion = new Version(winMinVerMajor, 0);
|
||||
else
|
||||
_minVersion = new Version(7, 0);
|
||||
}
|
||||
if (!Utilities.ParseVersion(Configuration.WindowsMinVer, out _minVersion))
|
||||
_minVersion = new Version(7, 0);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
Reference in New Issue
Block a user