12c593315Sopenharmony_ciadd_subdirectory(includes)
22c593315Sopenharmony_ci
32c593315Sopenharmony_ciinclude_directories(
42c593315Sopenharmony_ci  "${CMAKE_CURRENT_SOURCE_DIR}/includes"
52c593315Sopenharmony_ci  "${CMAKE_CURRENT_BINARY_DIR}/includes"
62c593315Sopenharmony_ci)
72c593315Sopenharmony_ci
82c593315Sopenharmony_ciadd_definitions(-DBUILDING_NGHTTP2)
92c593315Sopenharmony_ci
102c593315Sopenharmony_ciset(NGHTTP2_SOURCES
112c593315Sopenharmony_ci  nghttp2_pq.c nghttp2_map.c nghttp2_queue.c
122c593315Sopenharmony_ci  nghttp2_frame.c
132c593315Sopenharmony_ci  nghttp2_buf.c
142c593315Sopenharmony_ci  nghttp2_stream.c nghttp2_outbound_item.c
152c593315Sopenharmony_ci  nghttp2_session.c nghttp2_submit.c
162c593315Sopenharmony_ci  nghttp2_helper.c
172c593315Sopenharmony_ci  nghttp2_npn.c
182c593315Sopenharmony_ci  nghttp2_hd.c nghttp2_hd_huffman.c nghttp2_hd_huffman_data.c
192c593315Sopenharmony_ci  nghttp2_version.c
202c593315Sopenharmony_ci  nghttp2_priority_spec.c
212c593315Sopenharmony_ci  nghttp2_option.c
222c593315Sopenharmony_ci  nghttp2_callbacks.c
232c593315Sopenharmony_ci  nghttp2_mem.c
242c593315Sopenharmony_ci  nghttp2_http.c
252c593315Sopenharmony_ci  nghttp2_rcbuf.c
262c593315Sopenharmony_ci  nghttp2_extpri.c
272c593315Sopenharmony_ci  nghttp2_ratelim.c
282c593315Sopenharmony_ci  nghttp2_time.c
292c593315Sopenharmony_ci  nghttp2_debug.c
302c593315Sopenharmony_ci  sfparse.c
312c593315Sopenharmony_ci)
322c593315Sopenharmony_ci
332c593315Sopenharmony_ciset(NGHTTP2_RES "")
342c593315Sopenharmony_ci
352c593315Sopenharmony_ciif(WIN32)
362c593315Sopenharmony_ci  configure_file(
372c593315Sopenharmony_ci    version.rc.in
382c593315Sopenharmony_ci    ${CMAKE_CURRENT_BINARY_DIR}/version.rc
392c593315Sopenharmony_ci    @ONLY)
402c593315Sopenharmony_ci
412c593315Sopenharmony_ci  set(NGHTTP2_RES ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
422c593315Sopenharmony_ciendif()
432c593315Sopenharmony_ci
442c593315Sopenharmony_ci# Public shared library
452c593315Sopenharmony_ciif(ENABLE_SHARED_LIB)
462c593315Sopenharmony_ci  add_library(nghttp2 SHARED ${NGHTTP2_SOURCES} ${NGHTTP2_RES})
472c593315Sopenharmony_ci  set_target_properties(nghttp2 PROPERTIES
482c593315Sopenharmony_ci    COMPILE_FLAGS "${WARNCFLAGS}"
492c593315Sopenharmony_ci    VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION}
502c593315Sopenharmony_ci    C_VISIBILITY_PRESET hidden
512c593315Sopenharmony_ci  )
522c593315Sopenharmony_ci  target_include_directories(nghttp2 INTERFACE
532c593315Sopenharmony_ci    "${CMAKE_CURRENT_BINARY_DIR}/includes"
542c593315Sopenharmony_ci    "${CMAKE_CURRENT_SOURCE_DIR}/includes"
552c593315Sopenharmony_ci  )
562c593315Sopenharmony_ci
572c593315Sopenharmony_ci  install(TARGETS nghttp2
582c593315Sopenharmony_ci    ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
592c593315Sopenharmony_ci    LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
602c593315Sopenharmony_ci    RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
612c593315Sopenharmony_ciendif()
622c593315Sopenharmony_ci
632c593315Sopenharmony_ciif(HAVE_CUNIT OR ENABLE_STATIC_LIB)
642c593315Sopenharmony_ci  # Static library (for unittests because of symbol visibility)
652c593315Sopenharmony_ci  add_library(nghttp2_static STATIC ${NGHTTP2_SOURCES})
662c593315Sopenharmony_ci  set_target_properties(nghttp2_static PROPERTIES
672c593315Sopenharmony_ci    COMPILE_FLAGS "${WARNCFLAGS}"
682c593315Sopenharmony_ci    VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION}
692c593315Sopenharmony_ci    ARCHIVE_OUTPUT_NAME nghttp2${STATIC_LIB_SUFFIX}
702c593315Sopenharmony_ci  )
712c593315Sopenharmony_ci  target_compile_definitions(nghttp2_static PUBLIC "-DNGHTTP2_STATICLIB")
722c593315Sopenharmony_ci  if(ENABLE_STATIC_LIB)
732c593315Sopenharmony_ci    install(TARGETS nghttp2_static
742c593315Sopenharmony_ci      DESTINATION "${CMAKE_INSTALL_LIBDIR}")
752c593315Sopenharmony_ci  endif()
762c593315Sopenharmony_ciendif()
772c593315Sopenharmony_ci
782c593315Sopenharmony_ci
792c593315Sopenharmony_ciinstall(FILES "${CMAKE_CURRENT_BINARY_DIR}/libnghttp2.pc"
802c593315Sopenharmony_ci  DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
81