wolfssl icon indicating copy to clipboard operation
wolfssl copied to clipboard

make "yes;no" cmake options boolean instead of string

Open oltolm opened this issue 10 months ago • 3 comments

Description

Please describe the scope of the fix or feature addition.

Fixes https://github.com/wolfSSL/wolfssl/issues/5438

add_option in functions.cmake always produces variables of type string even for boolean options. I fixed it to produce boolean variables for options that only allow "yes;no".

oltolm avatar Apr 01 '24 14:04 oltolm

Can one of the admins verify this patch?

wolfSSL-Bot avatar Apr 01 '24 14:04 wolfSSL-Bot

Okay to test. Contributor agreement on file. Thank you @oltolm . Changes look great!

dgarske avatar Apr 01 '24 15:04 dgarske

Retest this please

dgarske avatar Apr 01 '24 17:04 dgarske

Those options that are still "yes" or "no" are not boolean. For example WOLFSSL_AESGCM is defined like this

add_option("WOLFSSL_AESGCM"
    "Enable wolfSSL AES-GCM support (default: enabled)"
    "yes" "yes;no;table;small;word32;4bit")

As you can see it's not a boolean option.

oltolm avatar May 15 '24 21:05 oltolm

Those options that are still "yes" or "no" are not boolean. For example WOLFSSL_AESGCM is defined like this

add_option("WOLFSSL_AESGCM"
    "Enable wolfSSL AES-GCM support (default: enabled)"
    "yes" "yes;no;table;small;word32;4bit")

As you can see it's not a boolean option.

That makes sense. I like the change. Does this change to use boolean fix an issue or is it more to improve your experience when building with CMake?

dgarske avatar May 15 '24 21:05 dgarske

Those options that are still "yes" or "no" are not boolean. For example WOLFSSL_AESGCM is defined like this

add_option("WOLFSSL_AESGCM"
    "Enable wolfSSL AES-GCM support (default: enabled)"
    "yes" "yes;no;table;small;word32;4bit")

As you can see it's not a boolean option.

That makes sense. I like the change. Does this change to use boolean fix an issue or is it more to improve your experience when building with CMake?

I remember having some kind of problem, but I couldn't reproduce it. It's just a general improvement. The CMake GUI now shows a checkbox instead of a dropdown for boolean options.

oltolm avatar May 15 '24 22:05 oltolm