2026-09-12 23:05:00 +10:00
|
|
|
#ifndef ANSMODELKEYS_H
|
|
|
|
|
#define ANSMODELKEYS_H
|
|
|
|
|
#pragma once
|
|
|
|
|
// ANSModelKeys — the keys this build was given, if it was given any.
|
|
|
|
|
//
|
|
|
|
|
// The base private key is not in this file and is not in the repository. It is
|
|
|
|
|
// written by the key ceremony (ANSMINDCORE's tools/ansmodel_keys.cpp) into
|
|
|
|
|
// ANSModelKeysGenerated.h, which is ignored by git and produced on the machine
|
|
|
|
|
// that builds a release. This header is the seam: it uses that file when it is
|
|
|
|
|
// there and says "no keys" when it is not.
|
|
|
|
|
//
|
|
|
|
|
// A BUILD WITHOUT THE KEY IS A VALID BUILD. Every zip still loads, and a
|
|
|
|
|
// 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.
|
|
|
|
|
|
2026-09-13 05:56:58 +10:00
|
|
|
// 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)
|
2026-09-12 23:05:00 +10:00
|
|
|
#include "ANSModelKeysGenerated.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include "ANSModelPackage.h"
|
|
|
|
|
|
|
|
|
|
namespace ANSCENTER {
|
|
|
|
|
namespace modelpkg {
|
|
|
|
|
|
|
|
|
|
// Add whatever this build ships with to a keyring. False when it ships with
|
|
|
|
|
// nothing, which is not an error.
|
|
|
|
|
inline bool AddBuiltInKeys(Keyring& ring) {
|
|
|
|
|
#if defined(ANSCORE_HAVE_BUILTIN_MODEL_KEYS)
|
|
|
|
|
return builtin::addBuiltInKeys(ring);
|
|
|
|
|
#else
|
|
|
|
|
(void)ring;
|
|
|
|
|
return false;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace modelpkg
|
|
|
|
|
} // namespace ANSCENTER
|
|
|
|
|
|
|
|
|
|
#endif // ANSMODELKEYS_H
|