option(ENABLE_ADNS "Build with adns support" ON)
option(ENABLE_PCRE "Build with pcre support" ON)
option(ENABLE_PORTAUDIO "Build with portaudio support" ON)
-option(ENABLE_Z "Build with zlib compression support" ON)
+option(ENABLE_ZLIB "Build with zlib compression support" ON)
option(ENABLE_LUA "Build with lua dissector support" ON)
option(ENABLE_PYTHON "Build with python dissector support" ON)
option(ENABLE_SMI "Build with smi snmp support" ON)
add_definitions( -D_U_=\"\" )
endif()
-# todo
-# Same for linker flags, but it looks like it's do-it-yourself here
-# AC_WIRESHARK_GCC_LDFLAGS_CHECK([-Wl,--as-needed])
-# AC_WIRESHARK_GCC_LDFLAGS_CHECK([-flto])
-# AC_WIRESHARK_GCC_LDFLAGS_CHECK([-fwhopr])
-# AC_WIRESHARK_GCC_LDFLAGS_CHECK([-fwhole-program])
+set(WIRESHARK_LD_FLAGS
+ -Wl,--as-needed
+ # -flto
+ # -fwhopr
+ # -fwhole-program
+)
+
+include(CheckCLinkerFlag)
+set(C 0)
+# Sigh: Have to use THIS_FLAG instead of ${F} for some reason
+foreach(THIS_FLAG ${WIRESHARK_LD_FLAGS})
+ set(F WS_LD_FLAG_${C})
+ set(${F} ${THIS_FLAG})
+ set(V WS_LD_FLAG_VALID${C})
+ check_c_linker_flag(${${F}} ${V})
+ if (${${V}})
+ set(WS_LINK_FLAGS ${WS_LINK_FLAGS} ${${F}})
+ endif()
+ math(EXPR C "${C} + 1")
+endforeach()
if(ENABLE_STATIC)
set(LINK_MODE_LIB STATIC)
endif()
# Zlib compression
-if(ENABLE_Z)
- set(PACKAGELIST Z ${PACKAGELIST})
+if(ENABLE_ZLIB)
+ set(PACKAGELIST ZLIB ${PACKAGELIST})
endif()
# Lua 5.1 dissectors
plugins/ethercat
plugins/giop
plugins/gryphon
+ plugins/interlink
plugins/irda
plugins/m2m
plugins/mate
)
add_executable(wireshark ${wireshark_FILES})
add_dependencies(wireshark svnversion)
+ set_target_properties(wireshark PROPERTIES LINK_FLAGS ${WS_LINK_FLAGS})
target_link_libraries(wireshark ${wireshark_LIBS})
install(TARGETS wireshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
)
add_executable(tshark ${tshark_FILES})
add_dependencies(tshark svnversion)
+ set_target_properties(tshark PROPERTIES LINK_FLAGS ${WS_LINK_FLAGS})
target_link_libraries(tshark ${tshark_LIBS})
install(TARGETS tshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
)
add_executable(rawshark ${rawshark_FILES})
add_dependencies(rawshark svnversion)
+ set_target_properties(rawshark PROPERTIES LINK_FLAGS ${WS_LINK_FLAGS})
target_link_libraries(rawshark ${rawshark_LIBS})
install(TARGETS rawshark RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
util.c
)
add_executable(dftest ${dftest_FILES})
+ set_target_properties(dftest PROPERTIES LINK_FLAGS ${WS_LINK_FLAGS})
target_link_libraries(dftest ${dftest_LIBS})
install(TARGETS dftest RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
randpkt.c
)
add_executable(randpkt ${randpkt_FILES})
+ set_target_properties(randpkt PROPERTIES LINK_FLAGS ${WS_LINK_FLAGS})
target_link_libraries(randpkt ${randpkt_LIBS})
install(TARGETS randpkt RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
)
add_executable(text2pcap ${text2pcap_FILES})
add_dependencies(text2pcap svnversion)
+ set_target_properties(text2pcap PROPERTIES LINK_FLAGS ${WS_LINK_FLAGS})
target_link_libraries(text2pcap ${text2pcap_LIBS})
install(TARGETS text2pcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
)
add_executable(mergecap ${mergecap_FILES})
add_dependencies(mergecap svnversion)
+ set_target_properties(mergecap PROPERTIES LINK_FLAGS ${WS_LINK_FLAGS})
target_link_libraries(mergecap ${mergecap_LIBS})
install(TARGETS mergecap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
${WTAP_PLUGIN_SOURCES}
)
add_executable(capinfos ${capinfos_FILES})
+ set_target_properties(capinfos PROPERTIES LINK_FLAGS ${WS_LINK_FLAGS})
target_link_libraries(capinfos ${capinfos_LIBS})
install(TARGETS capinfos RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
)
add_executable(editcap ${editcap_FILES})
add_dependencies(editcap svnversion)
+ set_target_properties(editcap PROPERTIES LINK_FLAGS ${WS_LINK_FLAGS})
target_link_libraries(editcap ${editcap_LIBS})
install(TARGETS editcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
)
add_executable(dumpcap ${dumpcap_FILES})
add_dependencies(dumpcap svnversion)
+ set_target_properties(dumpcap PROPERTIES LINK_FLAGS ${WS_LINK_FLAGS})
target_link_libraries(dumpcap ${dumpcap_LIBS})
install(TARGETS dumpcap RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()