2016-02-11 23:27:31 +01:00
|
|
|
add_subdirectory(includes)
|
|
|
|
|
2016-02-11 22:11:14 +01:00
|
|
|
include_directories(
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/includes"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/includes"
|
|
|
|
)
|
|
|
|
|
|
|
|
add_definitions(-DBUILDING_NGHTTP2)
|
|
|
|
|
|
|
|
set(NGHTTP2_SOURCES
|
|
|
|
nghttp2_pq.c nghttp2_map.c nghttp2_queue.c
|
|
|
|
nghttp2_frame.c
|
|
|
|
nghttp2_buf.c
|
|
|
|
nghttp2_stream.c nghttp2_outbound_item.c
|
|
|
|
nghttp2_session.c nghttp2_submit.c
|
|
|
|
nghttp2_helper.c
|
|
|
|
nghttp2_npn.c
|
|
|
|
nghttp2_hd.c nghttp2_hd_huffman.c nghttp2_hd_huffman_data.c
|
|
|
|
nghttp2_version.c
|
|
|
|
nghttp2_priority_spec.c
|
|
|
|
nghttp2_option.c
|
|
|
|
nghttp2_callbacks.c
|
|
|
|
nghttp2_mem.c
|
|
|
|
nghttp2_http.c
|
2016-03-13 16:19:23 +01:00
|
|
|
nghttp2_rcbuf.c
|
2016-10-12 18:11:59 +02:00
|
|
|
nghttp2_debug.c
|
2020-07-26 08:31:54 +02:00
|
|
|
nghttp2_ksl.c
|
2016-02-11 22:11:14 +01:00
|
|
|
)
|
|
|
|
|
2016-10-27 19:06:55 +02:00
|
|
|
set(NGHTTP2_RES "")
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
configure_file(
|
|
|
|
version.rc.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/version.rc
|
|
|
|
@ONLY)
|
|
|
|
|
|
|
|
set(NGHTTP2_RES ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
|
|
|
|
endif()
|
|
|
|
|
2016-02-16 16:04:01 +01:00
|
|
|
# Public shared library
|
2018-12-27 19:06:02 +01:00
|
|
|
if(ENABLE_SHARED_LIB)
|
|
|
|
add_library(nghttp2 SHARED ${NGHTTP2_SOURCES} ${NGHTTP2_RES})
|
|
|
|
set_target_properties(nghttp2 PROPERTIES
|
|
|
|
COMPILE_FLAGS "${WARNCFLAGS}"
|
|
|
|
VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION}
|
|
|
|
C_VISIBILITY_PRESET hidden
|
|
|
|
)
|
|
|
|
target_include_directories(nghttp2 INTERFACE
|
2017-08-16 20:28:12 +02:00
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/includes"
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/includes"
|
2018-12-27 19:06:02 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
install(TARGETS nghttp2
|
2019-02-06 19:26:30 +01:00
|
|
|
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
|
|
|
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
|
|
|
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
2018-12-27 19:06:02 +01:00
|
|
|
endif()
|
2016-02-16 16:04:01 +01:00
|
|
|
|
2018-03-12 23:29:46 +01:00
|
|
|
if(HAVE_CUNIT OR ENABLE_STATIC_LIB)
|
2016-02-16 16:04:01 +01:00
|
|
|
# Static library (for unittests because of symbol visibility)
|
|
|
|
add_library(nghttp2_static STATIC ${NGHTTP2_SOURCES})
|
|
|
|
set_target_properties(nghttp2_static PROPERTIES
|
|
|
|
COMPILE_FLAGS "${WARNCFLAGS}"
|
|
|
|
VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION}
|
2019-11-15 21:50:43 +01:00
|
|
|
ARCHIVE_OUTPUT_NAME nghttp2${STATIC_LIB_SUFFIX}
|
2016-02-16 16:04:01 +01:00
|
|
|
)
|
2016-03-17 23:32:07 +01:00
|
|
|
target_compile_definitions(nghttp2_static PUBLIC "-DNGHTTP2_STATICLIB")
|
2018-03-12 23:29:46 +01:00
|
|
|
if(ENABLE_STATIC_LIB)
|
|
|
|
install(TARGETS nghttp2_static
|
|
|
|
DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
|
|
|
endif()
|
2016-02-16 16:04:01 +01:00
|
|
|
endif()
|
2016-02-11 22:11:14 +01:00
|
|
|
|
|
|
|
|
|
|
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libnghttp2.pc"
|
|
|
|
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|