11cb0ef41Sopenharmony_ciadd_subdirectory(includes) 21cb0ef41Sopenharmony_ci 31cb0ef41Sopenharmony_ciinclude_directories( 41cb0ef41Sopenharmony_ci "${CMAKE_CURRENT_SOURCE_DIR}/includes" 51cb0ef41Sopenharmony_ci "${CMAKE_CURRENT_BINARY_DIR}/includes" 61cb0ef41Sopenharmony_ci) 71cb0ef41Sopenharmony_ci 81cb0ef41Sopenharmony_ciadd_definitions(-DBUILDING_NGHTTP2) 91cb0ef41Sopenharmony_ci 101cb0ef41Sopenharmony_ciset(NGHTTP2_SOURCES 111cb0ef41Sopenharmony_ci nghttp2_pq.c nghttp2_map.c nghttp2_queue.c 121cb0ef41Sopenharmony_ci nghttp2_frame.c 131cb0ef41Sopenharmony_ci nghttp2_buf.c 141cb0ef41Sopenharmony_ci nghttp2_stream.c nghttp2_outbound_item.c 151cb0ef41Sopenharmony_ci nghttp2_session.c nghttp2_submit.c 161cb0ef41Sopenharmony_ci nghttp2_helper.c 171cb0ef41Sopenharmony_ci nghttp2_npn.c 181cb0ef41Sopenharmony_ci nghttp2_hd.c nghttp2_hd_huffman.c nghttp2_hd_huffman_data.c 191cb0ef41Sopenharmony_ci nghttp2_version.c 201cb0ef41Sopenharmony_ci nghttp2_priority_spec.c 211cb0ef41Sopenharmony_ci nghttp2_option.c 221cb0ef41Sopenharmony_ci nghttp2_callbacks.c 231cb0ef41Sopenharmony_ci nghttp2_mem.c 241cb0ef41Sopenharmony_ci nghttp2_http.c 251cb0ef41Sopenharmony_ci nghttp2_rcbuf.c 261cb0ef41Sopenharmony_ci nghttp2_extpri.c 271cb0ef41Sopenharmony_ci nghttp2_ratelim.c 281cb0ef41Sopenharmony_ci nghttp2_time.c 291cb0ef41Sopenharmony_ci nghttp2_debug.c 301cb0ef41Sopenharmony_ci sfparse.c 311cb0ef41Sopenharmony_ci) 321cb0ef41Sopenharmony_ci 331cb0ef41Sopenharmony_ciset(NGHTTP2_RES "") 341cb0ef41Sopenharmony_ci 351cb0ef41Sopenharmony_ciif(WIN32) 361cb0ef41Sopenharmony_ci configure_file( 371cb0ef41Sopenharmony_ci version.rc.in 381cb0ef41Sopenharmony_ci ${CMAKE_CURRENT_BINARY_DIR}/version.rc 391cb0ef41Sopenharmony_ci @ONLY) 401cb0ef41Sopenharmony_ci 411cb0ef41Sopenharmony_ci set(NGHTTP2_RES ${CMAKE_CURRENT_BINARY_DIR}/version.rc) 421cb0ef41Sopenharmony_ciendif() 431cb0ef41Sopenharmony_ci 441cb0ef41Sopenharmony_ci# Public shared library 451cb0ef41Sopenharmony_ciif(ENABLE_SHARED_LIB) 461cb0ef41Sopenharmony_ci add_library(nghttp2 SHARED ${NGHTTP2_SOURCES} ${NGHTTP2_RES}) 471cb0ef41Sopenharmony_ci set_target_properties(nghttp2 PROPERTIES 481cb0ef41Sopenharmony_ci COMPILE_FLAGS "${WARNCFLAGS}" 491cb0ef41Sopenharmony_ci VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION} 501cb0ef41Sopenharmony_ci C_VISIBILITY_PRESET hidden 511cb0ef41Sopenharmony_ci ) 521cb0ef41Sopenharmony_ci target_include_directories(nghttp2 INTERFACE 531cb0ef41Sopenharmony_ci "${CMAKE_CURRENT_BINARY_DIR}/includes" 541cb0ef41Sopenharmony_ci "${CMAKE_CURRENT_SOURCE_DIR}/includes" 551cb0ef41Sopenharmony_ci ) 561cb0ef41Sopenharmony_ci 571cb0ef41Sopenharmony_ci install(TARGETS nghttp2 581cb0ef41Sopenharmony_ci ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" 591cb0ef41Sopenharmony_ci LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" 601cb0ef41Sopenharmony_ci RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") 611cb0ef41Sopenharmony_ciendif() 621cb0ef41Sopenharmony_ci 631cb0ef41Sopenharmony_ciif(HAVE_CUNIT OR ENABLE_STATIC_LIB) 641cb0ef41Sopenharmony_ci # Static library (for unittests because of symbol visibility) 651cb0ef41Sopenharmony_ci add_library(nghttp2_static STATIC ${NGHTTP2_SOURCES}) 661cb0ef41Sopenharmony_ci set_target_properties(nghttp2_static PROPERTIES 671cb0ef41Sopenharmony_ci COMPILE_FLAGS "${WARNCFLAGS}" 681cb0ef41Sopenharmony_ci VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION} 691cb0ef41Sopenharmony_ci ARCHIVE_OUTPUT_NAME nghttp2${STATIC_LIB_SUFFIX} 701cb0ef41Sopenharmony_ci ) 711cb0ef41Sopenharmony_ci target_compile_definitions(nghttp2_static PUBLIC "-DNGHTTP2_STATICLIB") 721cb0ef41Sopenharmony_ci if(ENABLE_STATIC_LIB) 731cb0ef41Sopenharmony_ci install(TARGETS nghttp2_static 741cb0ef41Sopenharmony_ci DESTINATION "${CMAKE_INSTALL_LIBDIR}") 751cb0ef41Sopenharmony_ci endif() 761cb0ef41Sopenharmony_ciendif() 771cb0ef41Sopenharmony_ci 781cb0ef41Sopenharmony_ci 791cb0ef41Sopenharmony_ciinstall(FILES "${CMAKE_CURRENT_BINARY_DIR}/libnghttp2.pc" 801cb0ef41Sopenharmony_ci DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") 81