1
0
mirror of https://github.com/wolfSSL/wolfssl.git synced 2026-10-24 04:09:07 +03:00

Key the STM32CubeMX2 configuration off a macro the pack declares

This commit is contained in:
David Garske
2026-09-14 13:08:39 -07:00
parent 0ed32f958f
commit ba1797509d
3 changed files with 12 additions and 20 deletions

View File

@@ -1001,6 +1001,7 @@ WOLFSSL_MONT_RED_CT
WOLFSSL_MP_COND_COPY
WOLFSSL_MP_INVMOD_CONSTANT_TIME
WOLFSSL_MULTICIRCULATE_ALTNAMELIST
WOLFSSL_MX2_CONF_INCLUDE
WOLFSSL_NETX_DUO
WOLFSSL_NEW_PRIME_CHECK
WOLFSSL_NOISE_SRC

View File

@@ -14,9 +14,12 @@ rendered by a Handlebars template through `cube codegen`, producing
- `mx_wolfSSL_conf_template.h.hbs` - the Handlebars template that renders
`mx_wolfSSL_conf.h`.
`wolfssl/wolfcrypt/settings.h` picks the generated header up automatically
via `__has_include("mx_wolfSSL_conf.h")` (HAL2 projects have no global
define like HAL1's `USE_HAL_DRIVER`).
`wolfssl/wolfcrypt/settings.h` includes the generated header when
`WOLFSSL_MX2_CONF_INCLUDE` is defined. HAL2 projects have no global define
like HAL1's `USE_HAL_DRIVER`, so the pack's configuration component declares
that macro through the generated `Pre_Include_Global.h` that STM32CubeMX2
force-includes. A project that adds these sources by hand, without the pack,
must define `WOLFSSL_MX2_CONF_INCLUDE` itself.
These files are packaged into the `wolfSSL.wolfSSL_middlewares` pack for
STM32CubeMX2 by the wolfSSL pack tooling; the pack build prefers the copies

View File

@@ -356,19 +356,6 @@
#endif
#endif
/* Probe for the STM32CubeMX2 generated configuration ahead of the chain
* below. __has_include must stay inside its own guarded block: preprocessors
* without it would otherwise fail parsing the #elif expression (the header
* name string is illegal in an integer constant expression), which the
* defined() short-circuit does not prevent. */
#if !defined(HAVE_CONFIG_H) && !defined(WOLFSSL_USER_SETTINGS) && \
!defined(WOLFSSL_OPTIONS_H) && !defined(WOLFSSL_NO_OPTIONS_H) && \
!defined(WOLFSSL_CUSTOM_CONFIG) && defined(__has_include)
#if __has_include("mx_wolfSSL_conf.h")
#define WOLFSSL_MX2_CONF_INCLUDE
#endif
#endif
#ifdef WOLFSSL_USER_SETTINGS
#if defined(BUILDING_WOLFSSL_ASM) && defined(WOLFSSL_USER_SETTINGS_ASM)
/*
@@ -390,10 +377,11 @@
#elif defined(USE_HAL_DRIVER) && !defined(HAVE_CONFIG_H)
/* STM Configuration File (generated by CubeMX) */
#include "wolfSSL.I-CUBE-wolfSSL_conf.h"
#elif defined(WOLFSSL_MX2_CONF_INCLUDE)
/* STM Configuration File (generated by STM32CubeMX2). HAL2 projects
* have no global define like HAL1's USE_HAL_DRIVER, so the probe
* above detects the generated configuration header itself. */
#elif defined(WOLFSSL_MX2_CONF_INCLUDE) && !defined(HAVE_CONFIG_H)
/* STM Configuration File (generated by STM32CubeMX2). HAL2 projects have
* no global define like HAL1's USE_HAL_DRIVER, so the wolfSSL pack's
* configuration component declares WOLFSSL_MX2_CONF_INCLUDE through the
* generated Pre_Include_Global.h, which the tool force-includes. */
#include "mx_wolfSSL_conf.h"
#elif defined(NUCLEUS_PLUS_2_3)
/* NOTE: cyassl_nucleus_defs.h is akin to user_settings.h */