Skip to content

Commit 495838a

Browse files
committed
third_party/nghttp2
1 parent f130fe2 commit 495838a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+38566
-0
lines changed

third_party/nghttp2/BUILD

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
package(default_visibility = ["//visibility:public"])
2+
3+
cc_library(
4+
name = "nghttp2",
5+
srcs = [
6+
"lib/nghttp2_alpn.c",
7+
"lib/nghttp2_alpn.h",
8+
"lib/nghttp2_buf.c",
9+
"lib/nghttp2_buf.h",
10+
"lib/nghttp2_callbacks.c",
11+
"lib/nghttp2_callbacks.h",
12+
"lib/nghttp2_debug.c",
13+
"lib/nghttp2_debug.h",
14+
"lib/nghttp2_extpri.c",
15+
"lib/nghttp2_extpri.h",
16+
"lib/nghttp2_frame.c",
17+
"lib/nghttp2_frame.h",
18+
"lib/nghttp2_hd.c",
19+
"lib/nghttp2_hd.h",
20+
"lib/nghttp2_hd_huffman.c",
21+
"lib/nghttp2_hd_huffman_data.c",
22+
"lib/nghttp2_hd_huffman.h",
23+
"lib/nghttp2_helper.c",
24+
"lib/nghttp2_helper.h",
25+
"lib/nghttp2_http.c",
26+
"lib/nghttp2_http.h",
27+
"lib/nghttp2_int.h",
28+
"lib/nghttp2_map.c",
29+
"lib/nghttp2_map.h",
30+
"lib/nghttp2_mem.c",
31+
"lib/nghttp2_mem.h",
32+
"lib/nghttp2_net.h",
33+
"lib/nghttp2_option.c",
34+
"lib/nghttp2_option.h",
35+
"lib/nghttp2_outbound_item.c",
36+
"lib/nghttp2_outbound_item.h",
37+
"lib/nghttp2_pq.c",
38+
"lib/nghttp2_pq.h",
39+
"lib/nghttp2_priority_spec.c",
40+
"lib/nghttp2_priority_spec.h",
41+
"lib/nghttp2_queue.c",
42+
"lib/nghttp2_queue.h",
43+
"lib/nghttp2_ratelim.c",
44+
"lib/nghttp2_ratelim.h",
45+
"lib/nghttp2_rcbuf.c",
46+
"lib/nghttp2_rcbuf.h",
47+
"lib/nghttp2_session.c",
48+
"lib/nghttp2_session.h",
49+
"lib/nghttp2_stream.c",
50+
"lib/nghttp2_stream.h",
51+
"lib/nghttp2_submit.c",
52+
"lib/nghttp2_submit.h",
53+
"lib/nghttp2_time.c",
54+
"lib/nghttp2_time.h",
55+
"lib/nghttp2_version.c",
56+
"lib/sfparse.c",
57+
"lib/sfparse.h",
58+
] + select({
59+
"@bazel_tools//src/conditions:linux": ["linux/config.h"],
60+
"@bazel_tools//src/conditions:windows": ["windows/config.h"],
61+
}),
62+
hdrs = [
63+
"lib/includes/nghttp2/nghttp2.h",
64+
"lib/includes/nghttp2/nghttp2ver.h",
65+
],
66+
includes = ["lib/includes"] + select({
67+
"@bazel_tools//src/conditions:linux": ["linux"],
68+
"@bazel_tools//src/conditions:windows": ["windows"],
69+
}),
70+
defines = [
71+
"HAVE_CONFIG_H",
72+
"NGHTTP2_STATICLIB",
73+
],
74+
)
+107
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
add_subdirectory(includes)
2+
3+
include_directories(
4+
"${CMAKE_CURRENT_SOURCE_DIR}/includes"
5+
"${CMAKE_CURRENT_BINARY_DIR}/includes"
6+
)
7+
8+
add_definitions(-DBUILDING_NGHTTP2)
9+
10+
set(NGHTTP2_SOURCES
11+
nghttp2_pq.c nghttp2_map.c nghttp2_queue.c
12+
nghttp2_frame.c
13+
nghttp2_buf.c
14+
nghttp2_stream.c nghttp2_outbound_item.c
15+
nghttp2_session.c nghttp2_submit.c
16+
nghttp2_helper.c
17+
nghttp2_alpn.c
18+
nghttp2_hd.c nghttp2_hd_huffman.c nghttp2_hd_huffman_data.c
19+
nghttp2_version.c
20+
nghttp2_priority_spec.c
21+
nghttp2_option.c
22+
nghttp2_callbacks.c
23+
nghttp2_mem.c
24+
nghttp2_http.c
25+
nghttp2_rcbuf.c
26+
nghttp2_extpri.c
27+
nghttp2_ratelim.c
28+
nghttp2_time.c
29+
nghttp2_debug.c
30+
sfparse.c
31+
)
32+
33+
set(NGHTTP2_RES "")
34+
set(STATIC_LIB "nghttp2_static")
35+
set(SHARED_LIB "nghttp2")
36+
37+
if(BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS AND MSVC AND NOT STATIC_LIB_SUFFIX)
38+
set(STATIC_LIB_SUFFIX "_static")
39+
endif()
40+
41+
if(WIN32)
42+
configure_file(
43+
version.rc.in
44+
${CMAKE_CURRENT_BINARY_DIR}/version.rc
45+
@ONLY)
46+
47+
set(NGHTTP2_RES ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
48+
endif()
49+
50+
set(EXPORT_SET "${PROJECT_NAME}-targets")
51+
52+
# Public shared library
53+
if(BUILD_SHARED_LIBS)
54+
add_library(${SHARED_LIB} SHARED ${NGHTTP2_SOURCES} ${NGHTTP2_RES})
55+
56+
set_target_properties(${SHARED_LIB} PROPERTIES
57+
COMPILE_FLAGS "${WARNCFLAGS}"
58+
VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION}
59+
C_VISIBILITY_PRESET hidden
60+
)
61+
62+
target_include_directories(${SHARED_LIB} INTERFACE
63+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/includes>
64+
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/includes>
65+
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
66+
)
67+
68+
install(TARGETS ${SHARED_LIB} EXPORT ${EXPORT_SET})
69+
list(APPEND nghttp2_exports ${SHARED_LIB})
70+
endif()
71+
72+
# Static library (for unittests because of symbol visibility)
73+
if(BUILD_STATIC_LIBS)
74+
add_library(${STATIC_LIB} STATIC ${NGHTTP2_SOURCES})
75+
76+
set_target_properties(${STATIC_LIB} PROPERTIES
77+
COMPILE_FLAGS "${WARNCFLAGS}"
78+
VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION}
79+
ARCHIVE_OUTPUT_NAME nghttp2${STATIC_LIB_SUFFIX}
80+
)
81+
82+
target_include_directories(${STATIC_LIB} INTERFACE
83+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/includes>
84+
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/includes>
85+
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
86+
)
87+
88+
target_compile_definitions(${STATIC_LIB} PUBLIC "-DNGHTTP2_STATICLIB")
89+
90+
install(TARGETS ${STATIC_LIB} EXPORT ${EXPORT_SET})
91+
list(APPEND nghttp2_exports ${STATIC_LIB})
92+
endif()
93+
94+
if(BUILD_SHARED_LIBS)
95+
set(LIB_SELECTED ${SHARED_LIB})
96+
else()
97+
set(LIB_SELECTED ${STATIC_LIB})
98+
endif()
99+
100+
add_library(${PROJECT_NAME}::nghttp2 ALIAS ${LIB_SELECTED})
101+
102+
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libnghttp2.pc"
103+
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
104+
105+
install(EXPORT ${EXPORT_SET}
106+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
107+
NAMESPACE ${PROJECT_NAME}::)

third_party/nghttp2/lib/Makefile.am

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# nghttp2 - HTTP/2 C Library
2+
3+
# Copyright (c) 2012, 2013 Tatsuhiro Tsujikawa
4+
5+
# Permission is hereby granted, free of charge, to any person obtaining
6+
# a copy of this software and associated documentation files (the
7+
# "Software"), to deal in the Software without restriction, including
8+
# without limitation the rights to use, copy, modify, merge, publish,
9+
# distribute, sublicense, and/or sell copies of the Software, and to
10+
# permit persons to whom the Software is furnished to do so, subject to
11+
# the following conditions:
12+
13+
# The above copyright notice and this permission notice shall be
14+
# included in all copies or substantial portions of the Software.
15+
16+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23+
SUBDIRS = includes
24+
25+
EXTRA_DIST = Makefile.msvc CMakeLists.txt version.rc.in
26+
27+
AM_CFLAGS = $(WARNCFLAGS) $(EXTRACFLAG)
28+
AM_CPPFLAGS = -I$(srcdir)/includes -I$(builddir)/includes -DBUILDING_NGHTTP2 \
29+
@DEFS@
30+
AM_LDFLAGS = @LIBTOOL_LDFLAGS@
31+
32+
pkgconfigdir = $(libdir)/pkgconfig
33+
pkgconfig_DATA = libnghttp2.pc
34+
DISTCLEANFILES = $(pkgconfig_DATA)
35+
36+
lib_LTLIBRARIES = libnghttp2.la
37+
38+
OBJECTS = nghttp2_pq.c nghttp2_map.c nghttp2_queue.c \
39+
nghttp2_frame.c \
40+
nghttp2_buf.c \
41+
nghttp2_stream.c nghttp2_outbound_item.c \
42+
nghttp2_session.c nghttp2_submit.c \
43+
nghttp2_helper.c \
44+
nghttp2_alpn.c \
45+
nghttp2_hd.c nghttp2_hd_huffman.c nghttp2_hd_huffman_data.c \
46+
nghttp2_version.c \
47+
nghttp2_priority_spec.c \
48+
nghttp2_option.c \
49+
nghttp2_callbacks.c \
50+
nghttp2_mem.c \
51+
nghttp2_http.c \
52+
nghttp2_rcbuf.c \
53+
nghttp2_extpri.c \
54+
nghttp2_ratelim.c \
55+
nghttp2_time.c \
56+
nghttp2_debug.c \
57+
sfparse.c
58+
59+
HFILES = nghttp2_pq.h nghttp2_int.h nghttp2_map.h nghttp2_queue.h \
60+
nghttp2_frame.h \
61+
nghttp2_buf.h \
62+
nghttp2_session.h nghttp2_helper.h nghttp2_stream.h nghttp2_int.h \
63+
nghttp2_alpn.h \
64+
nghttp2_submit.h nghttp2_outbound_item.h \
65+
nghttp2_net.h \
66+
nghttp2_hd.h nghttp2_hd_huffman.h \
67+
nghttp2_priority_spec.h \
68+
nghttp2_option.h \
69+
nghttp2_callbacks.h \
70+
nghttp2_mem.h \
71+
nghttp2_http.h \
72+
nghttp2_rcbuf.h \
73+
nghttp2_extpri.h \
74+
nghttp2_ratelim.h \
75+
nghttp2_time.h \
76+
nghttp2_debug.h \
77+
sfparse.h
78+
79+
libnghttp2_la_SOURCES = $(HFILES) $(OBJECTS)
80+
libnghttp2_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined \
81+
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)

0 commit comments

Comments
 (0)