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

cmake: fix parsing WOLFSSL_DEFINITIONS #7834

Merged
merged 1 commit into from
Aug 9, 2024
Merged

cmake: fix parsing WOLFSSL_DEFINITIONS #7834

merged 1 commit into from
Aug 9, 2024

Conversation

oltolm
Copy link
Contributor

@oltolm oltolm commented Aug 5, 2024

Description

There is a bug in the CMake code that parses WOLFSSL_DEFINITIONS at line 2336 in CMakeLists.txt. It uses

    if (DEFINED CMAKE_MATCH_4)

to check for a subgroup match. It stops working if there was a previous a previous regex match like this

string(REGEX MATCH "^(-D)?([^=]+)(=(.*))?$" outvar "-DVAR=VALUE")

which defines CMAKE_MATCH_4. The problem is that the next regex match does not undefine CMAKE_MATCH_4, it just sets it to the empty string.

To test it, insert

string(REGEX MATCH "^(-D)?([^=]+)(=(.*))?$" outvar "-DVAR=VALUE")

somewhere before the code and enable logging in lines 2340 and 2343.

@wolfSSL-Bot
Copy link

Can one of the admins verify this patch?

@dgarske
Copy link
Contributor

dgarske commented Aug 5, 2024

Okay to test - note we are having some GitHub CI issues

Copy link
Contributor

@dgarske dgarske left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebase to latest master to resolve GitHub CI issues. Contributor agreement on file. Let me know if you need help rebasing (I can do it from this side).

@dgarske dgarske self-assigned this Aug 5, 2024
@dgarske dgarske requested a review from douzzer August 6, 2024 17:20
@dgarske dgarske assigned douzzer and unassigned dgarske and oltolm Aug 6, 2024
@douzzer douzzer merged commit bba3995 into wolfSSL:master Aug 9, 2024
122 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants