Files
FlaxEngine/Source/Tools/Flax.Build/Deps/Dependencies/nvapi.cs
Wojtek Figat bc0e1f81e7 Add AGS third party module
AGS 6.3
2025-08-10 17:16:09 +02:00

58 lines
2.0 KiB
C#

// Copyright (c) Wojciech Figat. All rights reserved.
using Flax.Build;
using System.IO;
namespace Flax.Deps.Dependencies
{
/// <summary>
/// NVAPI is NVIDIA's core software development kit that allows direct access to NVIDIA GPUs and drivers on supported platforms.
/// https://github.com/NVIDIA/nvapi
/// </summary>
/// <seealso cref="Flax.Deps.Dependency" />
class nvapi : Dependency
{
/// <inheritdoc />
public override TargetPlatform[] Platforms
{
get => new[] { TargetPlatform.Windows };
}
/// <inheritdoc />
public override void Build(BuildOptions options)
{
var root = options.IntermediateFolder;
var moduleFolder = Path.Combine(options.ThirdPartyFolder, "nvapi");
// Get the source
CloneGitRepoFast(root, "https://github.com/NVIDIA/nvapi.git");
// Copy files
foreach (var platform in options.Platforms)
{
BuildStarted(platform);
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
Utilities.FileCopy(Path.Combine(root, "amd64/nvapi64.lib"), Path.Combine(depsFolder, "nvapi64.lib"));
}
// Copy license and header files
Utilities.FileCopy(Path.Combine(root, "License.txt"), Path.Combine(moduleFolder, "License.txt"));
var files = new[]
{
"nvHLSLExtns.h",
"nvHLSLExtnsInternal.h",
"nvapi.h",
"nvapi_lite_common.h",
"nvapi_lite_d3dext.h",
"nvapi_lite_salstart.h",
"nvapi_lite_salend.h",
"nvapi_lite_sli.h",
"nvapi_lite_stereo.h",
"nvapi_lite_surround.h",
};
foreach (var file in files)
Utilities.FileCopy(Path.Combine(root, file), Path.Combine(moduleFolder, file));
}
}
}