Skip to content

Commit

Permalink
in_http: fix linking to http library
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Silva <eduardo@treasure-data.com>
  • Loading branch information
edsiper committed Jun 11, 2015
1 parent a2ee8dc commit bc2757a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if(WITH_DEBUG)
endif()

# General Headers
include_directories(include/ lib/ lib/msgpack-0.5.9/src)
include_directories(include/ lib/ lib/msgpack-0.5.9/src lib/monkey/include)

# MSGPACK modification: disable the install routines.z
set(MSGPACK_NO_INSTALL 1)
Expand Down
2 changes: 2 additions & 0 deletions lib/monkey/mk_server/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")

set(src
monkey.c
mk_mimetype.c
Expand Down
4 changes: 3 additions & 1 deletion plugins/in_http/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ set(src
in_http.c)

FLB_PLUGIN(in_http "${src}" "")
target_link_libraries(flb-plugin-in_http ${CMAKE_BINARY_DIR}/library/libmonkey.a)
target_link_libraries(flb-plugin-in_http
${CMAKE_BINARY_DIR}/library/libmonkey.a
${CMAKE_DL_LIBS})
4 changes: 4 additions & 0 deletions plugins/in_http/in_http.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <unistd.h>

#include <msgpack.h>
#include <monkey/monkey.h>
#include <fluent-bit/flb_input.h>
#include <fluent-bit/flb_config.h>

Expand All @@ -30,6 +31,9 @@
/* Init CPU input */
int in_http_init(struct flb_config *config)
{
mk_config = mk_server_init();
mk_server_loop();

return 0;
}

Expand Down
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ set_target_properties(fluent-bit-static PROPERTIES

# Link dependencies to Fluent-Bit library core
target_link_libraries(fluent-bit-shared msgpack mk_core jsmn ${FLB_PLUGINS})
target_link_libraries(fluent-bit-static msgpack mk_core jsmn ${FLB_PLUGINS})
target_link_libraries(fluent-bit-static msgpack mk_core jsmn dl ${FLB_PLUGINS})

# Library install routines
install(TARGETS fluent-bit-shared LIBRARY DESTINATION lib)
Expand All @@ -45,7 +45,7 @@ install(TARGETS fluent-bit-shared LIBRARY DESTINATION lib)
if(NOT WITHOUT_BIN)
find_package (Threads)
add_executable(fluent-bit-bin fluent-bit.c)
target_link_libraries(fluent-bit-bin fluent-bit-static ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(fluent-bit-bin fluent-bit-static ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
set_target_properties(fluent-bit-bin
PROPERTIES OUTPUT_NAME fluent-bit)
install(TARGETS fluent-bit-bin RUNTIME DESTINATION bin)
Expand Down

0 comments on commit bc2757a

Please sign in to comment.