Optimizing source tree

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
main
Jianhui Zhao 2020-12-12 14:32:57 +08:00
parent 2c0cedc2bd
commit 0b2c2f4a3b
5 changed files with 11 additions and 19 deletions

View File

@ -12,3 +12,13 @@ if(BUILD_SHARED_LIBS)
else()
target_link_libraries(example uhttpd_s ${LIBEV_LIBRARY})
endif()
if(HAVE_DLOPEN)
add_library(test_plugin MODULE test_plugin.c)
set_target_properties(test_plugin PROPERTIES OUTPUT_NAME test_plugin PREFIX "")
install(
TARGETS test_plugin
LIBRARY DESTINATION lib/uhttpd
)
endif()

View File

@ -121,7 +121,7 @@ int main(int argc, char **argv)
srv->on_request = on_request;
srv->load_plugin(srv, "/usr/local/lib/uhttpd/test.so");
srv->load_plugin(srv, "/usr/local/lib/uhttpd/test_plugin.so");
uh_log_info("Listen on: *:%d\n", port);

View File

@ -138,10 +138,6 @@ endif()
# configure a header file to pass some of the CMake settings to the source code
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
if(HAVE_DLOPEN)
add_subdirectory(plugins)
endif()
install(
FILES
uhttpd.h

View File

@ -1,14 +0,0 @@
option(BUILD_TEST_PLUGIN "Build test plugin" ON)
set(PLUGINS "")
if(BUILD_TEST_PLUGIN)
set(PLUGINS ${PLUGINS} test_plugin)
add_library(test_plugin MODULE test.c)
set_target_properties(test_plugin PROPERTIES OUTPUT_NAME test PREFIX "")
endif()
install(
TARGETS ${PLUGINS}
LIBRARY DESTINATION lib/uhttpd
)