# Conflicts: # Content/Shaders/GI/DDGI.flax # Content/Shaders/GI/GlobalSurfaceAtlas.flax # Content/Shaders/TAA.flax # Content/Shaders/VolumetricFog.flax # Source/Editor/CustomEditors/Editors/ActorTagEditor.cs # Source/Engine/Core/Config/GraphicsSettings.cpp # Source/Engine/Engine/PostProcessEffect.cs # Source/Engine/Graphics/GPUResourcesCollection.cpp # Source/Engine/Graphics/GPUResourcesCollection.h # Source/Engine/Graphics/PostProcessBase.h # Source/FlaxEngine.Gen.cs
64 lines
1.8 KiB
C#
64 lines
1.8 KiB
C#
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
|
|
|
|
using System;
|
|
using System.Linq;
|
|
using Flax.Build;
|
|
using Flax.Build.NativeCpp;
|
|
|
|
/// <summary>
|
|
/// Target that builds standalone, native tests.
|
|
/// </summary>
|
|
public class FlaxTestsTarget : FlaxEditor
|
|
{
|
|
/// <inheritdoc />
|
|
public override void Init()
|
|
{
|
|
base.Init();
|
|
|
|
// Initialize
|
|
OutputName = "FlaxTests";
|
|
ConfigurationName = "Tests";
|
|
IsPreBuilt = false;
|
|
UseSymbolsExports = false;
|
|
Platforms = new[]
|
|
{
|
|
TargetPlatform.Windows,
|
|
TargetPlatform.Linux,
|
|
TargetPlatform.Mac,
|
|
};
|
|
Architectures = new[]
|
|
{
|
|
TargetArchitecture.x64,
|
|
};
|
|
Configurations = new[]
|
|
{
|
|
TargetConfiguration.Development,
|
|
};
|
|
GlobalDefinitions.Add("FLAX_TESTS");
|
|
Win32ResourceFile = null;
|
|
|
|
Modules.Add("Tests");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public override void SetupTargetEnvironment(BuildOptions options)
|
|
{
|
|
base.SetupTargetEnvironment(options);
|
|
|
|
options.ScriptingAPI.Defines.Add("FLAX_TESTS");
|
|
|
|
// Produce console program
|
|
options.LinkEnv.LinkAsConsoleProgram = true;
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public override Target SelectReferencedTarget(ProjectInfo project, Target[] projectTargets)
|
|
{
|
|
var testTargetName = "FlaxNativeTests"; // Should this be added to .flaxproj, similarly as "GameTarget" and "EditorTarget"?
|
|
var result = projectTargets.FirstOrDefault(x => x.Name == testTargetName);
|
|
if (result == null)
|
|
throw new Exception(string.Format("Invalid or missing test target {0} specified in project {1} (referenced by project {2}).", testTargetName, project.Name, Project.Name));
|
|
return result;
|
|
}
|
|
}
|