Improve e7016564b1 to reduce recompilation on commit changes

This commit is contained in:
2026-03-12 22:51:29 +01:00
parent d2a03b90ec
commit afe917a7f3
10 changed files with 25 additions and 11 deletions
-1
View File
@@ -3,7 +3,6 @@
#include "Audio.h" #include "Audio.h"
#include "AudioBackend.h" #include "AudioBackend.h"
#include "AudioSettings.h" #include "AudioSettings.h"
#include "FlaxEngine.Gen.h"
#include "Engine/Scripting/ScriptingType.h" #include "Engine/Scripting/ScriptingType.h"
#include "Engine/Scripting/BinaryModule.h" #include "Engine/Scripting/BinaryModule.h"
#include "Engine/Level/Level.h" #include "Engine/Level/Level.h"
+1 -1
View File
@@ -596,7 +596,7 @@ void EngineImpl::InitLog()
LOG(Info, "Compiled for Dev Environment"); LOG(Info, "Compiled for Dev Environment");
#endif #endif
#if defined(FLAXENGINE_BRANCH) && defined(FLAXENGINE_COMMIT) #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 #else
LOG(Info, "Version " FLAXENGINE_VERSION_TEXT); LOG(Info, "Version " FLAXENGINE_VERSION_TEXT);
#endif #endif
+1
View File
@@ -5,6 +5,7 @@
#include "Level.h" #include "Level.h"
#include "SceneQuery.h" #include "SceneQuery.h"
#include "SceneObjectsFactory.h" #include "SceneObjectsFactory.h"
#include "FlaxEngine.Gen.h"
#include "Scene/Scene.h" #include "Scene/Scene.h"
#include "Prefabs/Prefab.h" #include "Prefabs/Prefab.h"
#include "Prefabs/PrefabManager.h" #include "Prefabs/PrefabManager.h"
+1
View File
@@ -5,6 +5,7 @@
#include "LargeWorlds.h" #include "LargeWorlds.h"
#include "SceneQuery.h" #include "SceneQuery.h"
#include "SceneObjectsFactory.h" #include "SceneObjectsFactory.h"
#include "FlaxEngine.Gen.h"
#include "Scene/Scene.h" #include "Scene/Scene.h"
#include "Engine/Content/Content.h" #include "Engine/Content/Content.h"
#include "Engine/Content/Deprecated.h" #include "Engine/Content/Deprecated.h"
@@ -2,8 +2,6 @@
#pragma once #pragma once
#include "FlaxEngine.Gen.h"
class GPUTexture; class GPUTexture;
/// <summary> /// <summary>
@@ -4,7 +4,6 @@
#include "Engine/Core/Collections/Dictionary.h" #include "Engine/Core/Collections/Dictionary.h"
#include "Engine/Core/Types/Guid.h" #include "Engine/Core/Types/Guid.h"
#include "FlaxEngine.Gen.h"
/// <summary> /// <summary>
/// Object serialization modification base class. Allows to extend the serialization process by custom effects like object ids mapping. /// 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 class FLAXENGINE_API ISerializeModifier
{ {
public: public:
/// <summary> /// <summary>
/// Number of engine build when data was serialized. Useful to upgrade data from the older storage format. /// Number of engine build when data was serialized. Useful to upgrade data from the older storage format.
/// </summary> /// </summary>
uint32 EngineBuild = FLAXENGINE_VERSION_BUILD; uint32 EngineBuild;
// Utility for scene deserialization to track currently mapped in Prefab Instance object IDs into IdsMapping. // Utility for scene deserialization to track currently mapped in Prefab Instance object IDs into IdsMapping.
int32 CurrentInstance = -1; int32 CurrentInstance;
/// <summary> /// <summary>
/// The object IDs mapping. Key is a serialized object id, value is mapped value to use. /// The object IDs mapping. Key is a serialized object id, value is mapped value to use.
/// </summary> /// </summary>
Dictionary<Guid, Guid> IdsMapping; Dictionary<Guid, Guid> IdsMapping;
ISerializeModifier();
}; };
@@ -25,6 +25,13 @@
#include "Engine/Content/Asset.h" #include "Engine/Content/Asset.h"
#include "Engine/Level/SceneObject.h" #include "Engine/Level/SceneObject.h"
#include "Engine/Utilities/Encryption.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) void ISerializable::DeserializeIfExists(DeserializeStream& stream, const char* memberName, ISerializeModifier* modifier)
{ {
+1
View File
@@ -5,6 +5,7 @@
#include "JsonWriters.h" #include "JsonWriters.h"
#include "JsonSerializer.h" #include "JsonSerializer.h"
#include "MemoryReadStream.h" #include "MemoryReadStream.h"
#include "FlaxEngine.Gen.h"
#include "Engine/Core/Types/CommonValue.h" #include "Engine/Core/Types/CommonValue.h"
#include "Engine/Core/Types/Variant.h" #include "Engine/Core/Types/Variant.h"
#include "Engine/Core/Collections/Dictionary.h" #include "Engine/Core/Collections/Dictionary.h"
@@ -148,7 +148,6 @@ void ShadowsOfMordor::Builder::Dispose()
#include "Engine/Serialization/FileWriteStream.h" #include "Engine/Serialization/FileWriteStream.h"
#include "Engine/Engine/CommandLine.h" #include "Engine/Engine/CommandLine.h"
#include "Engine/Scripting/Scripting.h" #include "Engine/Scripting/Scripting.h"
#include "FlaxEngine.Gen.h"
namespace ShadowsOfMordor namespace ShadowsOfMordor
{ {
@@ -3290,12 +3290,16 @@ namespace Flax.Build.Bindings
contents.AppendLine($"#define {binaryModuleNameUpper}_COMPANY \"{project.Company}\""); contents.AppendLine($"#define {binaryModuleNameUpper}_COMPANY \"{project.Company}\"");
contents.AppendLine($"#define {binaryModuleNameUpper}_COPYRIGHT \"{project.Copyright}\""); contents.AppendLine($"#define {binaryModuleNameUpper}_COPYRIGHT \"{project.Copyright}\"");
if (project.VersionControlBranch.Length != 0) if (project.VersionControlBranch.Length != 0)
contents.AppendLine($"#define {binaryModuleNameUpper}_BRANCH \"{project.VersionControlBranch}\""); contents.AppendLine($"#define {binaryModuleNameUpper}_BRANCH {binaryModuleName}Branch");
if (project.VersionControlCommit.Length != 0) if (project.VersionControlCommit.Length != 0)
contents.AppendLine($"#define {binaryModuleNameUpper}_COMMIT \"{project.VersionControlCommit}\""); contents.AppendLine($"#define {binaryModuleNameUpper}_COMMIT {binaryModuleName}Commit");
contents.AppendLine(); contents.AppendLine();
contents.AppendLine("class BinaryModule;"); contents.AppendLine("class BinaryModule;");
contents.AppendLine($"extern \"C\" {binaryModuleNameUpper}_API BinaryModule* GetBinaryModule{binaryModuleName}();"); 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); GenerateCppBinaryModuleHeader?.Invoke(buildData, binaryModule, contents);
Utilities.WriteFileIfChanged(binaryModuleHeaderPath, contents.ToString()); Utilities.WriteFileIfChanged(binaryModuleHeaderPath, contents.ToString());
@@ -3321,6 +3325,10 @@ namespace Flax.Build.Bindings
} }
contents.AppendLine(" return &module;"); contents.AppendLine(" return &module;");
contents.AppendLine("}"); 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); GenerateCppBinaryModuleSource?.Invoke(buildData, binaryModule, contents);
Utilities.WriteFileIfChanged(binaryModuleSourcePath, contents.ToString()); Utilities.WriteFileIfChanged(binaryModuleSourcePath, contents.ToString());
PutStringBuilder(contents); PutStringBuilder(contents);