Skip to content

Comments

Remove dependency on pkg-config for wolfSSL#404

Draft
lapinozz wants to merge 1 commit intoThalhammer:masterfrom
CyrexWare:master
Draft

Remove dependency on pkg-config for wolfSSL#404
lapinozz wants to merge 1 commit intoThalhammer:masterfrom
CyrexWare:master

Conversation

@lapinozz
Copy link

pkg-config doesn't seem to be actually used for anything
it's simpler to use find_package() just like for the other libraries

@prince-chrismc
Copy link
Collaborator

What release was official cmake targets export by wolfssl? Do this require an update to the CI for what versions are tested against?

@lapinozz
Copy link
Author

lapinozz commented Jan 30, 2026

What release was official cmake targets export by wolfssl?

I don't understand the question

Do this require an update to the CI for what versions are tested against?

I'm not sure, I haven't checked the CI, I only tested to compile locally in static and shared build

I would just be a nice improvement since pck-config is an additional dependency and VS/MSVC doesn't come with it

@Thalhammer
Copy link
Owner

I am unsure if the official wolfssl distribution comes with cmake targets.
However even if it doesn't it might be worth it instead provide a FindWolfSSL.cmake file within the jwt-cpp repo and dropping pkg-config.

@prince-chrismc
Copy link
Collaborator

https://github.com/wolfSSL/wolfssl/blob/ca5b484e23beb4c033eaf8a9f5261cb417f39b4e/CMakeLists.txt#L3112-L3116

Seems they do have official CMake targets added ~3years ago... we are a bit behind

@prince-chrismc prince-chrismc changed the title Remove dependency on pkg-config Remove dependency on pkg-config for wolfSSL Feb 20, 2026
@prince-chrismc
Copy link
Collaborator

prince-chrismc commented Feb 20, 2026

@lapinozz are you using the wolfSSL CMake install? Are you using wolfSSL on windows?

having looked into myself, it's not mature enough shape for us to use it for jwt-cpp unfortunately. It was completely broken until wolfSSL/wolfssl@0319eb0. And looking into the code we'd need to test against... There's a few critical TODOs in their code for enable crypto https://github.com/wolfSSL/wolfssl/blob/9e5d03b23ece0d872fe20c3b6a1f1ee28dbd9912/CMakeLists.txt#L238 features.

Lastly I found wolfSSL/wolfssl@540b51e which looks promising because it allows the autoconf to export the required CMake targets actually build with the correct set of features. But this is completely unreleased and very ( 3 weeks ) new.

At this time I dont think we can remove the pkg-config requirement for wolfSSL.

@prince-chrismc
Copy link
Collaborator

Notes for future me to recall what I tried

 9150  sudo rm -rf /tmp/wolfssl-*
 9151  '/mnt/c/Users/Chris McArthur/Documents/jwt-cpp/.github/actions/install/wolfssl/install-wolfssl.sh' v5.7.0-stable
 9152  ls /usr/local/lib
 9153  ls /usr/local/lib/cmake
 9154  ls /usr/local/lib/pkgconfig
 9155  cd /tmp/wolfssl-5.7.0-stable
 9156  mkdir build
 9157  cd build
 9158  cmake ..
 9159  make -j $(nproc)
 9160  make install
 9161  cd ~
 9162* '/mnt/c/Users/Chris McArthur/Documents/jwt-cpp/.github/actions/install/wolfssl/install-wolfssl.sh' v5.7.6-stable
 9163  cd /tmp/wolfssl-5.7.6-stable
 9164  mkdir build
 9165  cmake ..
 9166  cd build
 9167  cmake ..
 9168  make install
 9169  cat /usr/local/lib/cmake/wolfssl/wolfssl-targets.cmake
 9170  cmake .. -DWOLFSSL_OPENSSLEXTRA=yes -DWOLFSSL_OPENSSLALL=yes
 9171  make install

@prince-chrismc
Copy link
Collaborator

If you can update your fork and show a working implemenation with something along the line os a new JWT_EXTERNAL_WOLFSSL feature flag I would be very open to considering adding an opening.

Something along the line of example-external-wolfssl.patch would be very much in line with how we've support other libraries

@prince-chrismc prince-chrismc marked this pull request as draft February 20, 2026 05:05
@lapinozz
Copy link
Author

I haven't tried with the wolfssl install at all, I only tried it with FetchContent. But for us that did work on Windows/linux/macs

I'll look into making it a feature flag like you suggested

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.

3 participants