Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake: missing ws2_32 (and psapi ?) linking for mingw builds #5180

Closed
rouault opened this issue Jan 26, 2022 · 1 comment
Closed

CMake: missing ws2_32 (and psapi ?) linking for mingw builds #5180

rouault opened this issue Jan 26, 2022 · 1 comment
Milestone

Comments

@rouault
Copy link
Member

rouault commented Jan 26, 2022

configure.ac has the following logic

dnl ---------------------------------------------------------------------------
dnl Check if we need -lws2_32 (mingw)
dnl ---------------------------------------------------------------------------

echo "#include <winsock2.h>" > test_ws2_32.c
echo "#include <ws2tcpip.h>" >> test_ws2_32.c
echo "void foo() {}" >> test_ws2_32.c

if test -z "`${CC} -c test_ws2_32.c 2>&1`" ; then
  LIBS="$LIBS -lws2_32"
fi
rm -f test_ws2_32*

dnl ---------------------------------------------------------------------------
dnl Check if we need -lpsapi (mingw)
dnl ---------------------------------------------------------------------------

echo "#include <windows.h>" > test_psapi.c
echo "#include <psapi.h>" >> test_psapi.c
echo "void foo() {}" >> test_psapi.c

if test -z "`${CC} -c test_psapi.c 2>&1`" ; then
  LIBS="$LIBS -lpsapi"
fi
rm -f test_psapi*

This hasn't been ported yet to cmake builds.
@rouault rouault added this to the 3.5.0 milestone Jan 26, 2022
@rouault
Copy link
Member Author

rouault commented Jan 30, 2022

From testing, this doesn't seem necessary. CMake automatically adds those libs!

@rouault rouault closed this as completed Jan 30, 2022
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

No branches or pull requests

1 participant