2016-02-12 14:28:07 +01:00
|
|
|
if(ENABLE_EXAMPLES)
|
2016-03-13 12:22:33 +01:00
|
|
|
file(GLOB c_sources *.c)
|
|
|
|
set_source_files_properties(${c_sources} PROPERTIES
|
|
|
|
COMPILE_FLAGS "${WARNCFLAGS}")
|
|
|
|
file(GLOB cxx_sources *.cc)
|
|
|
|
set_source_files_properties(${cxx_sources} PROPERTIES
|
|
|
|
COMPILE_FLAGS "${WARNCXXFLAGS} ${CXX1XCXXFLAGS}")
|
2016-02-12 14:28:07 +01:00
|
|
|
|
|
|
|
include_directories(
|
2017-08-16 20:28:12 +02:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/../third-party"
|
2018-11-23 12:44:36 +01:00
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/../third-party/llhttp/include"
|
2016-02-12 14:28:07 +01:00
|
|
|
|
2016-03-13 16:41:21 +01:00
|
|
|
${LIBEVENT_INCLUDE_DIRS}
|
2016-02-12 14:28:07 +01:00
|
|
|
${OPENSSL_INCLUDE_DIRS}
|
|
|
|
)
|
|
|
|
|
|
|
|
link_libraries(
|
|
|
|
nghttp2
|
|
|
|
${LIBEVENT_OPENSSL_LIBRARIES}
|
|
|
|
${OPENSSL_LIBRARIES}
|
|
|
|
${APP_LIBRARIES}
|
|
|
|
)
|
|
|
|
|
2018-11-23 12:44:36 +01:00
|
|
|
add_executable(client client.c $<TARGET_OBJECTS:llhttp>
|
|
|
|
$<TARGET_OBJECTS:url-parser>
|
|
|
|
)
|
|
|
|
add_executable(libevent-client libevent-client.c $<TARGET_OBJECTS:llhttp>
|
|
|
|
$<TARGET_OBJECTS:url-parser>
|
|
|
|
)
|
|
|
|
add_executable(libevent-server libevent-server.c $<TARGET_OBJECTS:llhttp>
|
|
|
|
$<TARGET_OBJECTS:url-parser>
|
|
|
|
)
|
|
|
|
add_executable(deflate deflate.c $<TARGET_OBJECTS:llhttp>
|
|
|
|
$<TARGET_OBJECTS:url-parser>
|
|
|
|
)
|
2016-02-12 14:28:07 +01:00
|
|
|
|
|
|
|
if(ENABLE_ASIO_LIB)
|
|
|
|
foreach(name asio-sv asio-sv2 asio-cl asio-cl2)
|
2018-11-23 12:44:36 +01:00
|
|
|
add_executable(${name} ${name}.cc $<TARGET_OBJECTS:llhttp>
|
|
|
|
$<TARGET_OBJECTS:url-parser>
|
|
|
|
)
|
2016-02-12 14:28:07 +01:00
|
|
|
target_include_directories(${name} PRIVATE
|
|
|
|
${OPENSSL_INCLUDE_DIRS}
|
|
|
|
${Boost_INCLUDE_DIRS}
|
|
|
|
)
|
|
|
|
target_link_libraries(${name}
|
|
|
|
nghttp2
|
|
|
|
nghttp2_asio
|
|
|
|
${JEMALLOC_LIBRARIES}
|
|
|
|
${OPENSSL_LIBRARIES}
|
|
|
|
${Boost_LIBRARIES}
|
|
|
|
${APP_LIBRARIES}
|
|
|
|
)
|
|
|
|
endforeach()
|
|
|
|
endif()
|
|
|
|
endif()
|