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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions rpcapd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,13 @@ if(WIN32 OR ((CMAKE_USE_PTHREADS_INIT OR PTHREADS_FOUND) AND HAVE_CRYPT))
OSX_ARCHITECTURES "${OSX_PROGRAM_ARCHITECTURES}")
endif()

if(WIN32)
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)
Comment on lines +115 to +121
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})


######################################
# Install rpcap daemon and man pages
Expand Down