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

libwebsockets is linked statically #2880

Open
narc-Ontakac2 opened this issue Aug 22, 2023 · 1 comment
Open

libwebsockets is linked statically #2880

narc-Ontakac2 opened this issue Aug 22, 2023 · 1 comment

Comments

@narc-Ontakac2
Copy link

narc-Ontakac2 commented Aug 22, 2023

Looking at the linker options when building with debuild on Debian bookworm I see

-lrt /usr/lib/x86_64-linux-gnu/libwebsockets.a

which tells me that libwebsockets is linked statically. In case that it is intentional and I overlooked a not so obvious switch - why?

The obvious switch in src/CMakeLists.txt tells me otherwise:

option(STATIC_WEBSOCKETS "Use the static libwebsockets library?" OFF)
@narc-Ontakac2
Copy link
Author

Libwebsockets changed its cmake interface. This adapts to that:

 if (WITH_WEBSOCKETS)
 	if (STATIC_WEBSOCKETS)
-		set (MOSQ_LIBS ${MOSQ_LIBS} websockets_static)
+		set (MOSQ_LIBS ${MOSQ_LIBS} websockets)
 		if (WIN32)
 			set (MOSQ_LIBS ${MOSQ_LIBS} iphlpapi)
 			link_directories(${mosquitto_SOURCE_DIR})
 		endif (WIN32)
 	else (STATIC_WEBSOCKETS)
-		set (MOSQ_LIBS ${MOSQ_LIBS} websockets)
+		set (MOSQ_LIBS ${MOSQ_LIBS} websockets_shared)
 	endif (STATIC_WEBSOCKETS)
 endif (WITH_WEBSOCKETS)

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