fix(keys): decide at configure time whether this build has the key
Whether the model-package key is present was an __has_include test inside the header, and that test leaves no dependency for the build system. A key emitted after a build had already compiled the file would not take effect until someone cleaned, and the resulting engine looks exactly like one built without a key — which on a release machine means shipping an engine that silently cannot open a package. CMake now decides it and says which case it is, so emitting the key and re-configuring is what installs it, visibly. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,11 +13,14 @@
|
||||
// package is refused with a sentence that says why. That is what keeps the key
|
||||
// out of a developer's checkout without keeping developers out of the code.
|
||||
|
||||
#if defined(__has_include)
|
||||
#if __has_include("ANSModelKeysGenerated.h")
|
||||
// ANSCORE_HAVE_BUILTIN_MODEL_KEYS is set by CMake when the ceremony's
|
||||
// generated header is there. It is not tested with __has_include on purpose:
|
||||
// that test leaves no dependency for the build system, so a key emitted after
|
||||
// a build would not take effect until someone cleaned — and the failure looks
|
||||
// exactly like a missing key, which on a release machine means shipping an
|
||||
// engine that silently cannot open a package.
|
||||
#if defined(ANSCORE_HAVE_BUILTIN_MODEL_KEYS)
|
||||
#include "ANSModelKeysGenerated.h"
|
||||
#define ANSCORE_HAVE_BUILTIN_MODEL_KEYS 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "ANSModelPackage.h"
|
||||
|
||||
Reference in New Issue
Block a user