Github user arpadboda commented on a diff in the pull request:

    https://github.com/apache/nifi-minifi-cpp/pull/430#discussion_r229111455
  
    --- Diff: nanofi/examples/CMakeLists.txt ---
    @@ -61,18 +61,18 @@ add_executable(generate_flow generate_flow.c)
     
     add_executable(terminate_handler terminate_handler.c)
     
    -target_link_libraries(generate_flow capi ${CMAKE_THREAD_LIBS_INIT} 
${LINK_FLAGS} minifi ${LINK_END_FLAGS})
    +target_link_libraries(generate_flow nanofi ${CMAKE_THREAD_LIBS_INIT})
     
    -target_link_libraries(terminate_handler capi ${CMAKE_THREAD_LIBS_INIT} 
${LINK_FLAGS} minifi ${LINK_END_FLAGS})
    +target_link_libraries(terminate_handler nanofi ${CMAKE_THREAD_LIBS_INIT})
     
     if (NOT WIN32)
     
     add_executable(transmit_flow transmit_flow.c)
     
    -target_link_libraries(transmit_flow capi ${CMAKE_THREAD_LIBS_INIT} 
${LINK_FLAGS} minifi ${LINK_END_FLAGS})
    +target_link_libraries(transmit_flow nanofi ${CMAKE_THREAD_LIBS_INIT})
     
     add_executable(monitor_directory monitor_directory.c)
     
    -target_link_libraries(monitor_directory capi ${CMAKE_THREAD_LIBS_INIT} 
${LINK_FLAGS} minifi ${LINK_END_FLAGS})
    +target_link_libraries(monitor_directory nanofi ${CMAKE_THREAD_LIBS_INIT})
    --- End diff --
    
    Are you sure this is fine?
    
    I see that nanofi is linked with whole-archive flag to make sure it 
contains all symbols from minifi, however when linking happens here and 
monitor_directory binary is created, the linker is still free to drop unused 
symbols. 
    
    Fix me, I would also be happy if we could skip doing that ugly flag-magic 
here. :) 
    



---

Reply via email to