Topic: cmake feature request

Would it be possible to provide an easy way to disable all default settings and only enable the compiler define
-DWOLFSSL_USER_SETTINGS?

This would make it easier to make quick changes to features and settings without having to use a complicated cmake command every time.

Regards,
John

Share

Re: cmake feature request

Hi stroebeljc,

Thanks for contacting wolfSSL!

We have made some improvements in our CMake build and that feature was likely missed.

I'll discuss this "enhancement" request with my colleague next week and get back to you.

Thanks,
Tesfa

Share

3 (edited by hayden 2021-01-04 08:19:59)

Re: cmake feature request

Hi John,

I recently overhauled wolfSSL's CMake, and Tesfa is correct, what you describe hasn't been added, yet. I'll take a look at it today; it shouldn't be very complex.

Thanks,

Hayden

Share

Re: cmake feature request

Hi John,

Could you give the changes in this pull request a try and see if it gets you what you need? https://github.com/wolfSSL/wolfssl/pull/3617/files

Thanks,

Hayden

Share

Re: cmake feature request

I still see -DHAVE_CONFIG_H in my compile command line, which is causing build errors.  How do I remove it?

Share

Re: cmake feature request

We strive to keep the CMake and autotools builds roughly equivalent, although the CMake build currently supports far fewer features than the autotools one. Enabling user settings in the autotools build still defines -DHAVE_CONFIG_H, hence why it's the same in the CMake build.

I can add an option to disable both generation of config.h and the defining of HAVE_CONFIG_H. It'll be off by default, for the reason stated above, but you can turn it on at the command line to get the behavior you want. I'll edit this post with the PR once it's up, as well as the command line option to use.

Share

Re: cmake feature request

I've added another CMake option, WOLFSSL_CONFIG_H, to the PR I linked above. Add -DWOLFSSL_CONFIG_H=no to your cmake command to turn off generation of config.h and the definition of HAVE_CONFIG_H.

Share

Re: cmake feature request

Thanks, @hayden.  That does work.

I found an issue with a missing define in my user_settings.h file that accounted for the compile problems.  However, the switch you added provides us with more confidence that the build configuration is as expected.

Share

Re: cmake feature request

Glad to hear it's working!

Share