Skip to content

Conversation

@pmcgaugh
Copy link

This change to the CMakeLists.txt fixes the MinGW / Windows build for my setup. It may not solve anyone else's problem.

I would like someone else with this build config (MinGW / Windows) to confirm that this PR will help with #268 before accepting it.

This change might be needed, but in addition, there might be further configuration errors in the setups present in #268 that are causing issues.

An alternative to this fix would be to place the linking burden on the application. If that is the desired workaround, feel free to close this PR.

Feedback appreciated.
Thank you!

Addresses babelouest#268
- gnutls needed to be moved to a later entry in the link list
- ws2_32 needed to be added to the link list

These were required to build for Win32 MinGW. I have not tested them in other setups.
@pmcgaugh
Copy link
Author

Forced some updates to address other issues including aligning the formatting of my additions with your code and moving the gnutls link position for a linking issue in Windows MinGW.

I did not test other platforms to confirm if this would cause issues on those.

I will have more information posted on #268.

@pmcgaugh pmcgaugh marked this pull request as ready for review April 23, 2025 17:53
Added a section into the INSTALL.md for how to get started in windows using MSYS.
@babelouest
Copy link
Owner

Thanks for the PR @pmcgaugh !

Although it's not ready yet.

For some reason, moving the find_package(GnuTLS REQUIRED) fixes your issue, but it involves disabling websocket support in all cases and I don't know why yet.

I believe it's a small fix but the cmake logic sometimes involves magic and mystery...

I'll try and find a fix when I'll have the time, although the workaround is to follow your documentation if I understand correctly.

@pmcgaugh
Copy link
Author

For work I need to use Windows, hence my current situation. I appreciate you doing a checkout to cover my lack of initial thoroughness!

If I find time soon I will switch over to my Linux desktop and try compiling and see if I can get the ordering right to make everyone happy (although I am not familiar with compiling with MSVC...)

@pmcgaugh
Copy link
Author

pmcgaugh commented May 4, 2025

I just tried compiling on Linux myself but did not have any issues. I should note that I am relying on uwsc as a test application.
...here was my setup to confirm differences:

Process:

git clone https://github.com/pmcgaugh/ulfius
cd ulfius
mkdir build
cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC=ON -DBUILD_UWSC=ON .
cmake --build build
sudo cmake --install build
sudo cp /usr/local/lib/libulfius.so.2.7 /usr/lib
uwsc --version
# ...etc

CMake Ouptut

-- Orcania found: 2.3.4
-- Yder found: 1.4.21
-- GNU TLS support:                ON
-- Websocket support:              ON
-- Websocket message list support: ON
-- Outgoing requests support:      ON
-- Jansson library support:        ON
-- Yder support:                   ON
-- Build uwsc application:         ON
-- Build shared library:           ON
-- Build static library:           ON
-- Build testing tree:             OFF
-- Install the header files:       ON
-- Build TAR.GZ package:           OFF
-- Build DEB package:              OFF
-- Build RPM package:              OFF
-- Build documentation:            OFF
-- GCC Version:                    15.1.1
-- CMake System:                   Linux-6.14.4-arch1-2

Please let me know if you see any obvious differences in your setup or anything I'm doing here!

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.

2 participants