Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate macro definition warnings: Espressif project missing WOLFSSL_USER_SETTINGS #6848

Closed
gojimmypi opened this issue Oct 6, 2023 · 1 comment
Assignees

Comments

@gojimmypi
Copy link
Contributor

gojimmypi commented Oct 6, 2023

Version

latest master

Description

As noted in #5909 (comment) there may be an unintuitive build time warning of the user_settings.h macros being redefined when using wolfSSL as a component in an ESP32 Espressif project (e.g. ESP-IDF). This includes using the managed component.

The cause of this is a missing WOLFSSL_USER_SETTINGS compiler definition. See the template example.

There should be a cmake check in the Espressif wolfssl component to more gracefully warn of the missing definition.

@gojimmypi
Copy link
Contributor Author

I believe all examples in all repos have been updated to address this issue.

See the template example app for the proper way to include the user_settings.h:

/* wolfSSL */
/* Always include wolfcrypt/settings.h before any other wolfSSL file.    */
/* Reminder: settings.h pulls in user_settings.h; don't include it here. */
#ifdef WOLFSSL_USER_SETTINGS
    #include <wolfssl/wolfcrypt/settings.h>
    #ifndef WOLFSSL_ESPIDF
        #warning "Problem with wolfSSL user_settings."
        #warning "Check components/wolfssl/include"
    #endif
    #include <wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h>
#else
    /* Define WOLFSSL_USER_SETTINGS project wide for settings.h to include   */
    /* wolfSSL user settings in ./components/wolfssl/include/user_settings.h */
    #error "Missing WOLFSSL_USER_SETTINGS in CMakeLists or Makefile:\
    CFLAGS +=-DWOLFSSL_USER_SETTINGS"
#endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant