Improve e7016564b1 to reduce recompilation on commit changes

This commit is contained in:
Wojtek Figat
2026-03-12 22:51:29 +01:00
parent d2a03b90ec
commit afe917a7f3
10 changed files with 25 additions and 11 deletions

View File

@@ -3,7 +3,6 @@
#include "Audio.h"
#include "AudioBackend.h"
#include "AudioSettings.h"
#include "FlaxEngine.Gen.h"
#include "Engine/Scripting/ScriptingType.h"
#include "Engine/Scripting/BinaryModule.h"
#include "Engine/Level/Level.h"

View File

@@ -596,7 +596,7 @@ void EngineImpl::InitLog()
LOG(Info, "Compiled for Dev Environment");
#endif
#if defined(FLAXENGINE_BRANCH) && defined(FLAXENGINE_COMMIT)
LOG(Info, "Version " FLAXENGINE_VERSION_TEXT ", " FLAXENGINE_BRANCH ", " FLAXENGINE_COMMIT);
LOG(Info, "Version " FLAXENGINE_VERSION_TEXT ", {}, {}", StringAsUTF16<>(FLAXENGINE_BRANCH).Get(), StringAsUTF16<>(FLAXENGINE_COMMIT).Get());
#else
LOG(Info, "Version " FLAXENGINE_VERSION_TEXT);
#endif

View File

@@ -5,6 +5,7 @@
#include "Level.h"
#include "SceneQuery.h"
#include "SceneObjectsFactory.h"
#include "FlaxEngine.Gen.h"
#include "Scene/Scene.h"
#include "Prefabs/Prefab.h"
#include "Prefabs/PrefabManager.h"

View File

@@ -5,6 +5,7 @@
#include "LargeWorlds.h"
#include "SceneQuery.h"
#include "SceneObjectsFactory.h"
#include "FlaxEngine.Gen.h"
#include "Scene/Scene.h"
#include "Engine/Content/Content.h"
#include "Engine/Content/Deprecated.h"

View File

@@ -2,8 +2,6 @@
#pragma once
#include "FlaxEngine.Gen.h"
class GPUTexture;
/// <summary>

View File

@@ -4,7 +4,6 @@
#include "Engine/Core/Collections/Dictionary.h"
#include "Engine/Core/Types/Guid.h"
#include "FlaxEngine.Gen.h"
/// <summary>
/// Object serialization modification base class. Allows to extend the serialization process by custom effects like object ids mapping.
@@ -12,17 +11,18 @@
class FLAXENGINE_API ISerializeModifier
{
public:
/// <summary>
/// Number of engine build when data was serialized. Useful to upgrade data from the older storage format.
/// </summary>
uint32 EngineBuild = FLAXENGINE_VERSION_BUILD;
uint32 EngineBuild;
// Utility for scene deserialization to track currently mapped in Prefab Instance object IDs into IdsMapping.
int32 CurrentInstance = -1;
int32 CurrentInstance;
/// <summary>
/// The object IDs mapping. Key is a serialized object id, value is mapped value to use.
/// </summary>
Dictionary<Guid, Guid> IdsMapping;
ISerializeModifier();
};

View File

@@ -25,6 +25,13 @@
#include "Engine/Content/Asset.h"
#include "Engine/Level/SceneObject.h"
#include "Engine/Utilities/Encryption.h"
#include "FlaxEngine.Gen.h"
ISerializeModifier::ISerializeModifier()
{
EngineBuild = FLAXENGINE_VERSION_BUILD;
CurrentInstance = -1;
}
void ISerializable::DeserializeIfExists(DeserializeStream& stream, const char* memberName, ISerializeModifier* modifier)
{

View File

@@ -5,6 +5,7 @@
#include "JsonWriters.h"
#include "JsonSerializer.h"
#include "MemoryReadStream.h"
#include "FlaxEngine.Gen.h"
#include "Engine/Core/Types/CommonValue.h"
#include "Engine/Core/Types/Variant.h"
#include "Engine/Core/Collections/Dictionary.h"

View File

@@ -148,7 +148,6 @@ void ShadowsOfMordor::Builder::Dispose()
#include "Engine/Serialization/FileWriteStream.h"
#include "Engine/Engine/CommandLine.h"
#include "Engine/Scripting/Scripting.h"
#include "FlaxEngine.Gen.h"
namespace ShadowsOfMordor
{

View File

@@ -3290,12 +3290,16 @@ namespace Flax.Build.Bindings
contents.AppendLine($"#define {binaryModuleNameUpper}_COMPANY \"{project.Company}\"");
contents.AppendLine($"#define {binaryModuleNameUpper}_COPYRIGHT \"{project.Copyright}\"");
if (project.VersionControlBranch.Length != 0)
contents.AppendLine($"#define {binaryModuleNameUpper}_BRANCH \"{project.VersionControlBranch}\"");
contents.AppendLine($"#define {binaryModuleNameUpper}_BRANCH {binaryModuleName}Branch");
if (project.VersionControlCommit.Length != 0)
contents.AppendLine($"#define {binaryModuleNameUpper}_COMMIT \"{project.VersionControlCommit}\"");
contents.AppendLine($"#define {binaryModuleNameUpper}_COMMIT {binaryModuleName}Commit");
contents.AppendLine();
contents.AppendLine("class BinaryModule;");
contents.AppendLine($"extern \"C\" {binaryModuleNameUpper}_API BinaryModule* GetBinaryModule{binaryModuleName}();");
if (project.VersionControlBranch.Length != 0)
contents.AppendLine($"extern \"C\" {binaryModuleNameUpper}_API const char* {binaryModuleName}Branch;");
if (project.VersionControlCommit.Length != 0)
contents.AppendLine($"extern \"C\" {binaryModuleNameUpper}_API const char* {binaryModuleName}Commit;");
GenerateCppBinaryModuleHeader?.Invoke(buildData, binaryModule, contents);
Utilities.WriteFileIfChanged(binaryModuleHeaderPath, contents.ToString());
@@ -3321,6 +3325,10 @@ namespace Flax.Build.Bindings
}
contents.AppendLine(" return &module;");
contents.AppendLine("}");
if (project.VersionControlBranch.Length != 0)
contents.AppendLine($"extern \"C\" const char* {binaryModuleName}Branch = \"{project.VersionControlBranch}\";");
if (project.VersionControlCommit.Length != 0)
contents.AppendLine($"extern \"C\" const char* {binaryModuleName}Commit = \"{project.VersionControlCommit}\";");
GenerateCppBinaryModuleSource?.Invoke(buildData, binaryModule, contents);
Utilities.WriteFileIfChanged(binaryModuleSourcePath, contents.ToString());
PutStringBuilder(contents);