2021-12-08 12:41:14 +03:00
|
|
|
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
# Licensed under the Apache 2.0 License.
|
|
|
|
|
|
|
|
set(NGHTTP2_PREFIX
|
|
|
|
${CCF_3RD_PARTY_EXPORTED_DIR}/nghttp2
|
|
|
|
CACHE PATH "Prefix to NGHTTP2 library"
|
|
|
|
)
|
|
|
|
|
|
|
|
set(NGHTTP2_SRCS
|
|
|
|
${NGHTTP2_PREFIX}/nghttp2_buf.c
|
|
|
|
${NGHTTP2_PREFIX}/nghttp2_callbacks.c
|
|
|
|
${NGHTTP2_PREFIX}/nghttp2_debug.c
|
|
|
|
${NGHTTP2_PREFIX}/nghttp2_frame.c
|
|
|
|
${NGHTTP2_PREFIX}/nghttp2_hd.c
|
|
|
|
${NGHTTP2_PREFIX}/nghttp2_hd_huffman.c
|
|
|
|
${NGHTTP2_PREFIX}/nghttp2_hd_huffman_data.c
|
|
|
|
${NGHTTP2_PREFIX}/nghttp2_helper.c
|
|
|
|
${NGHTTP2_PREFIX}/nghttp2_http.c
|
|
|
|
${NGHTTP2_PREFIX}/nghttp2_map.c
|
|
|
|
${NGHTTP2_PREFIX}/nghttp2_mem.c
|
|
|
|
${NGHTTP2_PREFIX}/nghttp2_npn.c
|
|
|
|
${NGHTTP2_PREFIX}/nghttp2_option.c
|
|
|
|
${NGHTTP2_PREFIX}/nghttp2_outbound_item.c
|
|
|
|
${NGHTTP2_PREFIX}/nghttp2_pq.c
|
|
|
|
${NGHTTP2_PREFIX}/nghttp2_priority_spec.c
|
|
|
|
${NGHTTP2_PREFIX}/nghttp2_queue.c
|
|
|
|
${NGHTTP2_PREFIX}/nghttp2_rcbuf.c
|
2022-07-20 11:52:47 +03:00
|
|
|
${NGHTTP2_PREFIX}/nghttp2_extpri.c
|
2021-12-08 12:41:14 +03:00
|
|
|
${NGHTTP2_PREFIX}/nghttp2_session.c
|
|
|
|
${NGHTTP2_PREFIX}/nghttp2_stream.c
|
|
|
|
${NGHTTP2_PREFIX}/nghttp2_submit.c
|
|
|
|
${NGHTTP2_PREFIX}/nghttp2_version.c
|
2023-09-05 11:33:57 +03:00
|
|
|
${NGHTTP2_PREFIX}/sfparse.c
|
2021-12-08 12:41:14 +03:00
|
|
|
)
|
|
|
|
|
2022-10-26 12:08:24 +03:00
|
|
|
if(COMPILE_TARGET STREQUAL "sgx")
|
2021-12-08 12:41:14 +03:00
|
|
|
add_enclave_library_c(nghttp2.enclave ${NGHTTP2_SRCS})
|
|
|
|
target_include_directories(
|
|
|
|
nghttp2.enclave PUBLIC $<BUILD_INTERFACE:${NGHTTP2_PREFIX}/includes>
|
|
|
|
$<INSTALL_INTERFACE:include/3rdparty/nghttp2>
|
|
|
|
)
|
2022-07-14 17:37:10 +03:00
|
|
|
target_compile_definitions(
|
|
|
|
nghttp2.enclave PUBLIC -DNGHTTP2_STATICLIB -DHAVE_ARPA_INET_H=1
|
|
|
|
)
|
2021-12-08 12:41:14 +03:00
|
|
|
|
|
|
|
install(
|
|
|
|
TARGETS nghttp2.enclave
|
|
|
|
EXPORT ccf
|
|
|
|
DESTINATION lib
|
|
|
|
)
|
2022-11-18 16:21:14 +03:00
|
|
|
elseif(COMPILE_TARGET STREQUAL "snp")
|
|
|
|
add_library(nghttp2.snp STATIC ${NGHTTP2_SRCS})
|
|
|
|
target_include_directories(
|
|
|
|
nghttp2.snp PUBLIC $<BUILD_INTERFACE:${NGHTTP2_PREFIX}/includes>
|
|
|
|
$<INSTALL_INTERFACE:include/3rdparty/nghttp2>
|
|
|
|
)
|
|
|
|
target_compile_definitions(
|
|
|
|
nghttp2.snp PUBLIC -DNGHTTP2_STATICLIB -DHAVE_ARPA_INET_H=1
|
|
|
|
)
|
|
|
|
add_san(nghttp2.snp)
|
|
|
|
set_property(TARGET nghttp2.snp PROPERTY POSITION_INDEPENDENT_CODE ON)
|
|
|
|
|
|
|
|
install(
|
|
|
|
TARGETS nghttp2.snp
|
|
|
|
EXPORT ccf
|
|
|
|
DESTINATION lib
|
|
|
|
)
|
2021-12-08 12:41:14 +03:00
|
|
|
endif()
|
|
|
|
|
|
|
|
add_library(nghttp2.host STATIC ${NGHTTP2_SRCS})
|
|
|
|
target_include_directories(
|
|
|
|
nghttp2.host PUBLIC $<BUILD_INTERFACE:${NGHTTP2_PREFIX}/includes>
|
|
|
|
$<INSTALL_INTERFACE:include/3rdparty/nghttp2>
|
|
|
|
)
|
2022-07-14 17:37:10 +03:00
|
|
|
target_compile_definitions(
|
|
|
|
nghttp2.host PUBLIC -DNGHTTP2_STATICLIB -DHAVE_ARPA_INET_H=1
|
|
|
|
)
|
2021-12-08 12:41:14 +03:00
|
|
|
add_san(nghttp2.host)
|
|
|
|
set_property(TARGET nghttp2.host PROPERTY POSITION_INDEPENDENT_CODE ON)
|
2022-11-01 15:54:35 +03:00
|
|
|
|
|
|
|
if(INSTALL_VIRTUAL_LIBRARIES)
|
|
|
|
install(
|
|
|
|
TARGETS nghttp2.host
|
|
|
|
EXPORT ccf
|
|
|
|
DESTINATION lib
|
|
|
|
)
|
|
|
|
endif()
|