Skip to content

[Bug]: Autoconf'ism in CMakeLists.txt #5438

@BrianAker

Description

@BrianAker

Contact Details

No response

Version

github

Description

From CMakeList.txt

add_option("WOLFSSL_CODING"
    "Enable coding base 16/64 (default: enabled)"
    "yes" "yes;no")

The above is an autoconf'ism(*). To have cmake's automation skills work for you, and all of the tooling around it, options need to be done in the style expected.

option(WOLFSSL_CODING "Enable coding base 16/64" ON)

cmake has a weakly typed boolean, so there are numerous values that will translate into "true", but by not using standard cmake syntax you are missing some number of benefits to cmake that cmake users will want.

I did look at function(add_option); is it a clever to turn bad input values into "some value". This will turn out very poorly for someone.

assert() !

This plainly allows corruption of builds based on not generating an error from invalid input.

*) FWIW even in autoconf, turning --enable-foo values into --foo=yes is pretty messy and is not good autoconf syntax. See AC_ARG_ENABLE().

Reproduction steps

No response

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions