Fix using Vulkan SDK header from system when cross-compiling
This commit is contained in:
@@ -88,10 +88,12 @@ public sealed class VulkanSdk : Sdk
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Tries the get includes folder path (header files). This handles uppercase and lowercase installations for all platforms.
|
/// Tries the get includes folder path (header files). This handles uppercase and lowercase installations for all platforms.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="platform">Target platform hint.</param>
|
||||||
/// <param name="includesFolderPath">The includes folder path.</param>
|
/// <param name="includesFolderPath">The includes folder path.</param>
|
||||||
/// <returns>True if got valid folder, otherwise false.</returns>
|
/// <returns>True if got valid folder, otherwise false.</returns>
|
||||||
public bool TryGetIncludePath(out string includesFolderPath)
|
public bool TryGetIncludePath(TargetPlatform platform, out string includesFolderPath)
|
||||||
{
|
{
|
||||||
|
includesFolderPath = string.Empty;
|
||||||
if (IsValid)
|
if (IsValid)
|
||||||
{
|
{
|
||||||
var vulkanSdk = RootPath;
|
var vulkanSdk = RootPath;
|
||||||
@@ -99,6 +101,11 @@ public sealed class VulkanSdk : Sdk
|
|||||||
// Use system-installed headers
|
// Use system-installed headers
|
||||||
if (vulkanSdk.EndsWith("/include") && Directory.Exists(vulkanSdk))
|
if (vulkanSdk.EndsWith("/include") && Directory.Exists(vulkanSdk))
|
||||||
{
|
{
|
||||||
|
if (platform != Flax.Build.Platform.BuildTargetPlatform)
|
||||||
|
{
|
||||||
|
Log.Warning(string.Format("Cannot use system-installed VulkanSDK at {0} when building for platform {1}", vulkanSdk, platform));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
includesFolderPath = vulkanSdk;
|
includesFolderPath = vulkanSdk;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -123,8 +130,6 @@ public sealed class VulkanSdk : Sdk
|
|||||||
foreach (var include in includes)
|
foreach (var include in includes)
|
||||||
Log.Warning(string.Format("No Vulkan header files in {0}", include));
|
Log.Warning(string.Format("No Vulkan header files in {0}", include));
|
||||||
}
|
}
|
||||||
|
|
||||||
includesFolderPath = string.Empty;
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
2
Source/ThirdParty/volk/volk.Build.cs
vendored
2
Source/ThirdParty/volk/volk.Build.cs
vendored
@@ -48,7 +48,7 @@ public class volk : ThirdPartyModule
|
|||||||
}
|
}
|
||||||
|
|
||||||
string includesFolderPath;
|
string includesFolderPath;
|
||||||
if (VulkanSdk.Instance.TryGetIncludePath(out includesFolderPath))
|
if (VulkanSdk.Instance.TryGetIncludePath(options.Platform.Target, out includesFolderPath))
|
||||||
{
|
{
|
||||||
options.PublicIncludePaths.Add(includesFolderPath);
|
options.PublicIncludePaths.Add(includesFolderPath);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user