Skip to content

Commit 9437e55

Browse files
committed
Core: Add extra linker flag for BSD systems
As is, the ipfixcol2 symbols wouldn't be getting exported and all plugins would fail with undefined reference errors when trying to access them.
1 parent eafb097 commit 9437e55

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/core/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ target_link_libraries(ipfixcol2base
7979

8080
# Build IPFIXCOL2 exacutable with all symbols from the base library
8181
set(BASE_LIB -Wl,--whole-archive ipfixcol2base -Wl,--no-whole-archive)
82+
if (CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_HOST_SYSTEM_NAME STREQUAL "OpenBSD")
83+
set(BASE_LIB ${BASE_LIB} -rdynamic)
84+
endif()
85+
8286
add_executable(ipfixcol2 main.cpp)
8387
target_link_libraries(ipfixcol2 ${BASE_LIB})
8488
set_target_properties(ipfixcol2 PROPERTIES # by default, hide all symbols

0 commit comments

Comments
 (0)