wolfssl icon indicating copy to clipboard operation
wolfssl copied to clipboard

Add liboqs integration to CMake build system

Open darktohka opened this issue 3 years ago • 6 comments
trafficstars

Description

Currently, compiling WolfSSL with liboqs is only possible with the configure system.

I've created this PR to add liboqs support to the CMake build system. Now, CMake can detect liboqs and link to it when building with WOLFSSL_OQS on.

I've added a new CMake option: WOLFSSL_OQS, which is disabled by default. When enabled, CMake will look for the liboqs library, and, if found, will link and include it to the wolfssl library. This matches the behavior of the configure system.

Testing

I've tested this option with multiple configurations:

  • WOLFSSL_OQS off, no liboqs installed on system --> nothing happens
  • WOLFSSL_OQS on, no liboqs installed on system --> nothing happens
  • WOLFSSL_OQS on, liboqs installed on system as shared library --> liboqs is successfully linked to wolfssl dynamically
  • WOLFSSL_OQS on, liboqs installed on system as static library --> liboqs is successfully linked to wolfssl statically

Checklist

  • [ ] added tests
  • [ ] updated/added doxygen
  • [ ] updated appropriate READMEs
  • [ ] Updated manual and documentation

darktohka avatar Jul 27 '22 09:07 darktohka

Can one of the wolfSSL admins verify this patch?

wolfSSL-Bot avatar Jul 27 '22 09:07 wolfSSL-Bot

Hi @darktohka !

This is excellent work! In order for us to make use of it you will have to agree to our contributor agreement. Can you please mail [email protected] requesting a contributor agreement? Please mention that Anthony Hu (me) has asked you to do so.

Warm regards, Anthony

anhu avatar Jul 27 '22 13:07 anhu

Thank you @anhu! I've e-mailed the address you've given me and will update this thread when I hear back.

darktohka avatar Jul 27 '22 14:07 darktohka

On-hold until contributor agreement has been approved.

anhu avatar Jul 27 '22 14:07 anhu

Approved as contributor.

embhorn avatar Aug 01 '22 13:08 embhorn

retest this please

dgarske avatar Aug 04 '22 15:08 dgarske

retest this please

anhu avatar Aug 11 '22 19:08 anhu

Hi @darktohka ,

The failing test indicates that you will need to add an entry into cmake/include.am for the new file that you created.

Warm regards, Anthony

anhu avatar Aug 12 '22 14:08 anhu

Thank you @anhu, I have made the requested change.

darktohka avatar Aug 12 '22 20:08 darktohka

Excellent! Once the tests pass, I will squash and merge your changes.

anhu avatar Aug 12 '22 20:08 anhu