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

[bugfix] build rpcapd static on Windows #1056

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

blackliner
Copy link

@blackliner blackliner commented Oct 25, 2021

Currently, the build system tries to link rpcapd to the shared version of libpcap unconditionally, but this library is not created in a static build -DBUILD_SHARED_LIBS=OFF

Why don't you just link to the static version all the time, did you have any issues in the past?

Currently, the build system tries to link `rpcapd ` to the shared version of `libpcap` unconditionally, but this library is not created in a static build `-DBUILD_SHARED_LIBS=OFF`
Comment on lines +115 to +121
if(WIN32 AND BUILD_SHARED_LIBS)
target_link_libraries(rpcapd ${LIBRARY_NAME}
${RPCAPD_LINK_LIBRARIES} ${PCAP_LINK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
else(WIN32)
else(WIN32 AND BUILD_SHARED_LIBS)
target_link_libraries(rpcapd ${LIBRARY_NAME}_static
${RPCAPD_LINK_LIBRARIES} ${PCAP_LINK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
endif(WIN32)
endif(WIN32 AND BUILD_SHARED_LIBS)
Copy link
Author

@blackliner blackliner Oct 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, why not link to ${LIBRARY_NAME}_static all the time? Like this:

target_link_libraries(rpcapd ${LIBRARY_NAME}_static
  ${RPCAPD_LINK_LIBRARIES} ${PCAP_LINK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants