2020-07-01 06:48:42 +00:00
|
|
|
include_directories(
|
|
|
|
${CMAKE_SOURCE_DIR}/src
|
|
|
|
${CMAKE_SOURCE_DIR}/src/http-parser
|
|
|
|
${CMAKE_SOURCE_DIR}/src/buffer
|
|
|
|
${CMAKE_BINARY_DIR}/src
|
|
|
|
${LIBEV_INCLUDE_DIR})
|
2017-12-30 04:24:00 +00:00
|
|
|
|
2021-01-08 16:01:32 +00:00
|
|
|
set(LIBS ${LIBEV_LIBRARY})
|
2020-04-06 17:01:30 +00:00
|
|
|
|
|
|
|
if(BUILD_SHARED_LIBS)
|
2021-01-08 16:01:32 +00:00
|
|
|
list(APPEND LIBS uhttpd)
|
2020-04-06 17:01:30 +00:00
|
|
|
else()
|
2021-01-08 16:01:32 +00:00
|
|
|
list(APPEND LIBS uhttpd_s)
|
2020-04-06 17:01:30 +00:00
|
|
|
endif()
|
2020-12-12 06:32:57 +00:00
|
|
|
|
2021-01-08 16:01:32 +00:00
|
|
|
add_executable(simple_server simple_server.c handler.c)
|
|
|
|
target_link_libraries(simple_server ${LIBS})
|
|
|
|
|
|
|
|
add_executable(multi_process_server_reuseport multi_process_server_reuseport.c handler.c)
|
|
|
|
target_link_libraries(multi_process_server_reuseport ${LIBS})
|
|
|
|
|
|
|
|
add_executable(multi_process_server multi_process_server.c handler.c)
|
|
|
|
target_link_libraries(multi_process_server ${LIBS})
|
|
|
|
|
2020-12-12 06:32:57 +00:00
|
|
|
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()
|