• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# nghttp2 - HTTP/2 C Library
2#
3# Copyright (c) 2012, 2013, 2014, 2015 Tatsuhiro Tsujikawa
4# Copyright (c) 2016 Peter Wu <peter@lekensteyn.nl>
5#
6# Permission is hereby granted, free of charge, to any person obtaining
7# a copy of this software and associated documentation files (the
8# "Software"), to deal in the Software without restriction, including
9# without limitation the rights to use, copy, modify, merge, publish,
10# distribute, sublicense, and/or sell copies of the Software, and to
11# permit persons to whom the Software is furnished to do so, subject to
12# the following conditions:
13#
14# The above copyright notice and this permission notice shall be
15# included in all copies or substantial portions of the Software.
16#
17# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
25cmake_minimum_required(VERSION 3.14)
26# XXX using 1.8.90 instead of 1.9.0-DEV
27project(nghttp2 VERSION 1.64.0 LANGUAGES C)
28
29# See versioning rule:
30#  https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
31set(LT_CURRENT  42)
32set(LT_REVISION 3)
33set(LT_AGE      28)
34
35set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
36include(Version)
37
38math(EXPR LT_SOVERSION "${LT_CURRENT} - ${LT_AGE}")
39set(LT_VERSION "${LT_SOVERSION}.${LT_AGE}.${LT_REVISION}")
40set(PACKAGE_VERSION     "${PROJECT_VERSION}")
41HexVersion(PACKAGE_VERSION_NUM ${PROJECT_VERSION_MAJOR} ${PROJECT_VERSION_MINOR} ${PROJECT_VERSION_PATCH})
42
43if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
44  set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the build type" FORCE)
45
46  # Include "None" as option to disable any additional (optimization) flags,
47  # relying on just CMAKE_C_FLAGS and CMAKE_CXX_FLAGS (which are empty by
48  # default). These strings are presented in cmake-gui.
49  set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
50    "None" "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
51endif()
52
53include(GNUInstallDirs)
54include(CMakeDependentOption)
55
56# For documentation
57find_package(Python3 COMPONENTS Interpreter)
58
59# Auto-detection of features that can be toggled
60if(NOT ENABLE_LIB_ONLY)
61  enable_language(CXX)
62  find_package(Libev 4.11)
63  find_package(Libcares 1.7.5)
64  find_package(ZLIB 1.2.3)
65  find_package(Libbrotlienc 1.0.9)
66  find_package(Libbrotlidec 1.0.9)
67endif()
68
69if(WITH_WOLFSSL)
70  find_package(WolfSSL 5.7.0)
71else()
72  find_package(OpenSSL 1.1.1)
73endif()
74find_package(Libngtcp2 1.0.0)
75if(OPENSSL_FOUND)
76  find_package(Libngtcp2_crypto_quictls 1.0.0)
77  if(LIBNGTCP2_CRYPTO_QUICTLS_FOUND)
78    set(HAVE_LIBNGTCP2_CRYPTO_QUICTLS 1)
79  endif()
80endif()
81if(WOLFSSL_FOUND)
82  find_package(Libngtcp2_crypto_wolfssl 1.0.0)
83  if(LIBNGTCP2_CRYPTO_WOLFSSL_FOUND)
84    set(HAVE_LIBNGTCP2_CRYPTO_WOLFSSL 1)
85  endif()
86endif()
87find_package(Libnghttp3 1.1.0)
88if(WITH_LIBBPF)
89  find_package(Libbpf 0.7.0)
90  if(NOT LIBBPF_FOUND)
91    message(FATAL_ERROR "libbpf was requested (WITH_LIBBPF=1) but not found.")
92  endif()
93endif()
94if((OPENSSL_FOUND OR WOLFSSL_FOUND) AND LIBEV_FOUND AND ZLIB_FOUND)
95  set(ENABLE_APP_DEFAULT ON)
96else()
97  set(ENABLE_APP_DEFAULT OFF)
98endif()
99find_package(Systemd 209)
100find_package(Jansson  2.5)
101set(ENABLE_HPACK_TOOLS_DEFAULT ${JANSSON_FOUND})
102# 2.0.8 is required because we use evconnlistener_set_error_cb()
103find_package(Libevent 2.0.8 COMPONENTS core extra openssl)
104set(ENABLE_EXAMPLES_DEFAULT ${LIBEVENT_OPENSSL_FOUND})
105
106find_package(LibXml2 2.6.26)
107set(WITH_LIBXML2_DEFAULT    ${LIBXML2_FOUND})
108find_package(Jemalloc)
109set(WITH_JEMALLOC_DEFAULT   ${JEMALLOC_FOUND})
110
111include(CMakeOptions.txt)
112
113if(ENABLE_LIB_ONLY AND (ENABLE_APP OR ENABLE_HPACK_TOOLS OR ENABLE_EXAMPLES))
114  # Remember when disabled options are disabled for later diagnostics.
115  set(ENABLE_LIB_ONLY_DISABLED_OTHERS 1)
116else()
117  set(ENABLE_LIB_ONLY_DISABLED_OTHERS 0)
118endif()
119if(ENABLE_LIB_ONLY)
120  set(ENABLE_APP            OFF)
121  set(ENABLE_HPACK_TOOLS    OFF)
122  set(ENABLE_EXAMPLES       OFF)
123endif()
124
125# Do not disable assertions based on CMAKE_BUILD_TYPE.
126foreach(_build_type "Release" "MinSizeRel" "RelWithDebInfo")
127  foreach(_lang C CXX)
128    string(TOUPPER "CMAKE_${_lang}_FLAGS_${_build_type}" _var)
129    string(REGEX REPLACE "(^| )[/-]D *NDEBUG($| )" " " ${_var} "${${_var}}")
130  endforeach()
131endforeach()
132
133if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
134  set(HINT_NORETURN       "__attribute__((noreturn))")
135else()
136  set(HINT_NORETURN)
137endif()
138
139if(NOT ENABLE_LIB_ONLY)
140  include(ExtractValidFlags)
141  foreach(_cxx1x_flag -std=c++20)
142    extract_valid_cxx_flags(_cxx1x_flag_supported ${_cxx1x_flag})
143    if(_cxx1x_flag_supported)
144      set(CXX1XCXXFLAGS ${_cxx1x_flag})
145      break()
146    endif()
147  endforeach()
148
149  include(CMakePushCheckState)
150  include(CheckCXXSourceCompiles)
151  cmake_push_check_state()
152  set(CMAKE_REQUIRED_DEFINITIONS "${CXX1XCXXFLAGS}")
153  # Check that std::future is available.
154  check_cxx_source_compiles("
155  #include <vector>
156  #include <future>
157  int main() { std::vector<std::future<int>> v; }" HAVE_STD_FUTURE)
158  # Check that std::map::emplace is available for g++-4.7.
159  check_cxx_source_compiles("
160  #include <map>
161  int main() { std::map<int, int>().emplace(1, 2); }" HAVE_STD_MAP_EMPLACE)
162  cmake_pop_check_state()
163endif()
164
165# Checks for libraries.
166# Additional libraries required for programs under src directory.
167set(APP_LIBRARIES)
168
169set(CMAKE_THREAD_PREFER_PTHREAD 1)
170find_package(Threads)
171if(CMAKE_USE_PTHREADS_INIT)
172  list(APPEND APP_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
173endif()
174# XXX android and C++, is this still needed in cmake?
175# case "$host" in
176#   *android*)
177#     android_build=yes
178#     # android does not need -pthread, but needs following 3 libs for C++
179#     APPLDFLAGS="$APPLDFLAGS -lstdc++ -latomic -lsupc++"
180
181# dl: openssl requires libdl when it is statically linked.
182# XXX shouldn't ${CMAKE_DL_LIBS} be appended to OPENSSL_LIBRARIES instead of
183# APP_LIBRARIES if it is really specific to OpenSSL?
184
185enable_testing()
186add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
187
188# openssl (for src)
189include(CheckSymbolExists)
190set(HAVE_OPENSSL    ${OPENSSL_FOUND})
191if(NOT ENABLE_LIB_ONLY AND OPENSSL_FOUND)
192  set(OPENSSL_INCLUDE_DIRS  ${OPENSSL_INCLUDE_DIR})
193  cmake_push_check_state()
194  set(CMAKE_REQUIRED_INCLUDES   "${OPENSSL_INCLUDE_DIR}")
195  set(CMAKE_REQUIRED_LIBRARIES  "${OPENSSL_LIBRARIES}")
196  if(WIN32)
197    set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}" "ws2_32" "bcrypt")
198  endif()
199  if(ENABLE_HTTP3)
200    check_symbol_exists(SSL_provide_quic_data "openssl/ssl.h" HAVE_SSL_PROVIDE_QUIC_DATA)
201    if(NOT HAVE_SSL_PROVIDE_QUIC_DATA)
202        message(WARNING "OpenSSL in ${OPENSSL_LIBRARIES} does not have SSL_provide_quic_data.  HTTP/3 support cannot be enabled")
203    endif()
204  endif()
205  cmake_pop_check_state()
206else()
207  set(OPENSSL_INCLUDE_DIRS  "")
208  set(OPENSSL_LIBRARIES     "")
209endif()
210# wolfSSL (for src)
211set(HAVE_WOLFSSL ${WOLFSSL_FOUND})
212if(WOLFSSL_FOUND)
213  set(WOLFSSL_INCLUDE_DIRS ${WOLFSSL_INCLUDE_DIR})
214  cmake_push_check_state()
215  set(CMAKE_REQUIRED_INCLUDES   "${WOLFSSL_INCLUDE_DIR}")
216  set(CMAKE_REQUIRED_LIBRARIES  "${WOLFSSL_LIBRARIES}")
217  check_symbol_exists(SSL_provide_quic_data "wolfssl/options.h;wolfssl/ssl.h" HAVE_WOLFSSL_SSL_PROVIDE_QUIC_DATA)
218  if(NOT HAVE_WOLFSSL_SSL_PROVIDE_QUIC_DATA)
219    message(WARNING "wolfSSL in ${WOLFSSL_LIBRARIES} does not have SSL_provide_quic_data.  HTTP/3 support cannot be enabled")
220  endif()
221  cmake_pop_check_state()
222else()
223  set(WOLFSSL_INCLUDE_DIRS "")
224  set(WOLFSSL_LIBRARIES    "")
225endif()
226# libev (for src)
227set(HAVE_LIBEV      ${LIBEV_FOUND})
228set(HAVE_ZLIB       ${ZLIB_FOUND})
229set(HAVE_SYSTEMD    ${SYSTEMD_FOUND})
230set(HAVE_LIBEVENT_OPENSSL ${LIBEVENT_FOUND})
231if(LIBEVENT_FOUND)
232  # Must both link the core and openssl libraries.
233  set(LIBEVENT_OPENSSL_LIBRARIES ${LIBEVENT_LIBRARIES})
234endif()
235# libc-ares (for src)
236set(HAVE_LIBCARES   ${LIBCARES_FOUND})
237if(LIBCARES_FOUND)
238  set(LIBCARES_INCLUDE_DIRS ${LIBCARES_INCLUDE_DIR})
239else()
240  set(LIBCARES_INCLUDE_DIRS "")
241  set(LIBCARES_LIBRARIES    "")
242endif()
243# jansson (for src/nghttp, src/deflatehd and src/inflatehd)
244set(HAVE_JANSSON    ${JANSSON_FOUND})
245# libxml2 (for src/nghttp)
246set(HAVE_LIBXML2    ${LIBXML2_FOUND})
247if(LIBXML2_FOUND)
248  set(LIBXML2_INCLUDE_DIRS  ${LIBXML2_INCLUDE_DIR})
249else()
250  set(LIBXML2_INCLUDE_DIRS  "")
251  set(LIBXML2_LIBRARIES     "")
252endif()
253# jemalloc
254set(HAVE_JEMALLOC   ${JEMALLOC_FOUND})
255
256# libbrotli (for src)
257set(HAVE_LIBBROTLIENC ${LIBBROTLIENC_FOUND})
258set(HAVE_LIBBROTLIDEC ${LIBBROTLIDEC_FOUND})
259if(LIBBROTLIENC_FOUND AND LIBBROTLIDEC_FOUND)
260  set(HAVE_LIBBROTLI 1)
261endif()
262
263# libbpf (for bpf)
264set(HAVE_LIBBPF ${LIBBPF_FOUND})
265if(LIBBPF_FOUND)
266  set(BPFCFLAGS -Wall -O2 -g)
267  if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
268    # For Debian/Ubuntu
269    set(EXTRABPFCFLAGS -I/usr/include/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu)
270  endif()
271
272  check_c_source_compiles("
273#include <linux/bpf.h>
274int main() { enum bpf_stats_type foo; (void)foo; }" HAVE_BPF_STATS_TYPE)
275endif()
276
277# The nghttp, nghttpd and nghttpx under src depend on zlib, OpenSSL and libev
278if(ENABLE_APP AND NOT (ZLIB_FOUND AND (OPENSSL_FOUND OR WOLFSSL_FOUND) AND LIBEV_FOUND))
279  message(FATAL_ERROR "Applications were requested (ENABLE_APP=1) but dependencies are not met.")
280endif()
281
282# HTTP/3 requires libngtcp2 + (quictls/openssl +
283# libngtcp2_crypto_quictls or wolfSSL + libngtcp2_crypto_wolfssl) and
284# libnghttp3.
285if(ENABLE_HTTP3 AND NOT (LIBNGTCP2_FOUND AND LIBNGHTTP3_FOUND AND
286      ((HAVE_SSL_PROVIDE_QUIC_DATA AND LIBNGTCP2_CRYPTO_QUICTLS_FOUND) OR
287	(HAVE_WOLFSSL_SSL_PROVIDE_QUIC_DATA AND LIBNGTCP2_CRYPTO_WOLFSSL_FOUND))))
288  message(FATAL_ERROR "HTTP/3 was requested (ENABLE_HTTP3=1) but dependencies are not met.")
289endif()
290
291# HPACK tools requires jansson
292if(ENABLE_HPACK_TOOLS AND NOT HAVE_JANSSON)
293  message(FATAL_ERROR "HPACK tools were requested (ENABLE_HPACK_TOOLS=1) but dependencies are not met.")
294endif()
295
296# examples
297if(ENABLE_EXAMPLES AND NOT (OPENSSL_FOUND AND LIBEVENT_OPENSSL_FOUND))
298  message(FATAL_ERROR "examples were requested (ENABLE_EXAMPLES=1) but dependencies are not met.")
299endif()
300
301# third-party http-parser only be built when needed
302if(ENABLE_EXAMPLES OR ENABLE_APP OR ENABLE_HPACK_TOOLS)
303  set(ENABLE_THIRD_PARTY 1)
304  # mruby (for src/nghttpx)
305  set(HAVE_MRUBY      ${WITH_MRUBY})
306  set(HAVE_NEVERBLEED ${WITH_NEVERBLEED})
307else()
308  set(HAVE_MRUBY 0)
309  set(HAVE_NEVERBLEED 0)
310endif()
311
312# Checks for header files.
313include(CheckIncludeFile)
314check_include_file("arpa/inet.h"    HAVE_ARPA_INET_H)
315check_include_file("fcntl.h"        HAVE_FCNTL_H)
316check_include_file("inttypes.h"     HAVE_INTTYPES_H)
317check_include_file("limits.h"       HAVE_LIMITS_H)
318check_include_file("netdb.h"        HAVE_NETDB_H)
319check_include_file("netinet/in.h"   HAVE_NETINET_IN_H)
320check_include_file("netinet/ip.h"   HAVE_NETINET_IP_H)
321check_include_file("pwd.h"          HAVE_PWD_H)
322check_include_file("sys/socket.h"   HAVE_SYS_SOCKET_H)
323check_include_file("sys/time.h"     HAVE_SYS_TIME_H)
324check_include_file("syslog.h"       HAVE_SYSLOG_H)
325check_include_file("unistd.h"       HAVE_UNISTD_H)
326check_include_file("windows.h"      HAVE_WINDOWS_H)
327
328include(CheckTypeSize)
329# Checks for typedefs, structures, and compiler characteristics.
330# AC_TYPE_SIZE_T
331check_type_size("ssize_t" SIZEOF_SSIZE_T)
332if(SIZEOF_SSIZE_T STREQUAL "")
333  # ssize_t is a signed type in POSIX storing at least -1.
334  # Set it to "int" to match the behavior of AC_TYPE_SSIZE_T (autotools).
335  set(ssize_t int)
336endif()
337# AC_TYPE_UINT8_T
338# AC_TYPE_UINT16_T
339# AC_TYPE_UINT32_T
340# AC_TYPE_UINT64_T
341# AC_TYPE_INT8_T
342# AC_TYPE_INT16_T
343# AC_TYPE_INT32_T
344# AC_TYPE_INT64_T
345# AC_TYPE_OFF_T
346# AC_TYPE_PID_T
347# AC_TYPE_UID_T
348# XXX To support inline for crappy compilers, see https://cmake.org/Wiki/CMakeTestInline
349# AC_C_INLINE
350# XXX is AC_SYS_LARGEFILE still needed for modern systems?
351# add_definitions(-D_FILE_OFFSET_BITS=64)
352
353include(CheckStructHasMember)
354check_struct_has_member("struct tm" tm_gmtoff time.h HAVE_STRUCT_TM_TM_GMTOFF)
355
356# Checks for library functions.
357include(CheckFunctionExists)
358check_function_exists(_Exit     HAVE__EXIT)
359check_function_exists(accept4   HAVE_ACCEPT4)
360check_function_exists(clock_gettime HAVE_CLOCK_GETTIME)
361check_function_exists(mkostemp  HAVE_MKOSTEMP)
362check_function_exists(pipe2     HAVE_PIPE2)
363
364check_symbol_exists(GetTickCount64 sysinfoapi.h HAVE_GETTICKCOUNT64)
365
366include(CheckSymbolExists)
367# XXX does this correctly detect initgroups (un)availability on cygwin?
368check_symbol_exists(initgroups grp.h HAVE_DECL_INITGROUPS)
369if(NOT HAVE_DECL_INITGROUPS AND HAVE_UNISTD_H)
370  # FreeBSD declares initgroups() in unistd.h
371  check_symbol_exists(initgroups unistd.h HAVE_DECL_INITGROUPS2)
372  if(HAVE_DECL_INITGROUPS2)
373    set(HAVE_DECL_INITGROUPS 1)
374  endif()
375endif()
376
377check_symbol_exists(CLOCK_MONOTONIC "time.h" HAVE_DECL_CLOCK_MONOTONIC)
378
379set(WARNCFLAGS)
380set(WARNCXXFLAGS)
381if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
382  if(ENABLE_WERROR)
383    set(WARNCFLAGS    /WX)
384    set(WARNCXXFLAGS  /WX)
385  endif()
386else()
387  if(ENABLE_WERROR)
388    set(WARNCFLAGS   "-Werror")
389    set(WARNCXXFLAGS "-Werror")
390  endif()
391
392  include(PickyWarningsC)
393  include(PickyWarningsCXX)
394endif()
395
396if(ENABLE_STATIC_CRT)
397  foreach(lang C CXX)
398    foreach(suffix "" _DEBUG _MINSIZEREL _RELEASE _RELWITHDEBINFO)
399      set(var "CMAKE_${lang}_FLAGS${suffix}")
400      string(REPLACE "/MD" "/MT" ${var} "${${var}}")
401    endforeach()
402  endforeach()
403endif()
404
405if(ENABLE_DEBUG)
406  set(DEBUGBUILD 1)
407endif()
408
409# Some platform does not have working std::future.  We disable
410# threading for those platforms.
411if(NOT ENABLE_THREADS OR NOT HAVE_STD_FUTURE)
412  set(NOTHREADS 1)
413endif()
414
415add_definitions(-DHAVE_CONFIG_H)
416configure_file(cmakeconfig.h.in config.h)
417# autotools-compatible names
418# Sphinx expects relative paths in the .rst files. Use the fact that the files
419# below are all one directory level deep.
420file(RELATIVE_PATH top_srcdir   "${CMAKE_CURRENT_BINARY_DIR}/dir" "${CMAKE_CURRENT_SOURCE_DIR}")
421file(RELATIVE_PATH top_builddir "${CMAKE_CURRENT_BINARY_DIR}/dir" "${CMAKE_CURRENT_BINARY_DIR}")
422set(abs_top_srcdir  "${CMAKE_CURRENT_SOURCE_DIR}")
423set(abs_top_builddir "${CMAKE_CURRENT_BINARY_DIR}")
424# libnghttp2.pc (pkg-config file)
425set(prefix          "${CMAKE_INSTALL_PREFIX}")
426set(exec_prefix     "${CMAKE_INSTALL_PREFIX}")
427set(libdir          "${CMAKE_INSTALL_FULL_LIBDIR}")
428set(includedir      "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
429set(VERSION         "${PACKAGE_VERSION}")
430# For init scripts and systemd service file (in contrib/)
431set(bindir          "${CMAKE_INSTALL_FULL_BINDIR}")
432set(sbindir         "${CMAKE_INSTALL_FULL_SBINDIR}")
433foreach(name
434   lib/libnghttp2.pc
435   lib/includes/nghttp2/nghttp2ver.h
436   integration-tests/config.go
437   integration-tests/setenv
438   doc/conf.py
439   doc/index.rst
440   doc/package_README.rst
441   doc/tutorial-client.rst
442   doc/tutorial-server.rst
443   doc/tutorial-hpack.rst
444   doc/nghttpx-howto.rst
445   doc/h2load-howto.rst
446   doc/building-android-binary.rst
447   doc/nghttp2.h.rst
448   doc/nghttp2ver.h.rst
449   doc/contribute.rst
450)
451  configure_file("${name}.in" "${name}" @ONLY)
452endforeach()
453
454if(APPLE)
455  add_definitions(-D__APPLE_USE_RFC_3542)
456endif()
457
458include_directories(
459  "${CMAKE_CURRENT_BINARY_DIR}" # for config.h
460)
461# For use in src/CMakeLists.txt
462set(PKGDATADIR "${CMAKE_INSTALL_FULL_DATADIR}/${CMAKE_PROJECT_NAME}")
463set(PKGLIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}/${CMAKE_PROJECT_NAME}")
464
465install(FILES README.rst DESTINATION "${CMAKE_INSTALL_DOCDIR}")
466
467add_subdirectory(lib)
468#add_subdirectory(lib/includes)
469add_subdirectory(third-party)
470add_subdirectory(src)
471add_subdirectory(examples)
472if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
473  add_subdirectory(tests)
474  #add_subdirectory(tests/testdata)
475  add_subdirectory(integration-tests)
476endif()
477if(ENABLE_DOC)
478  add_subdirectory(doc)
479endif()
480add_subdirectory(contrib)
481add_subdirectory(script)
482add_subdirectory(bpf)
483
484
485string(TOUPPER "${CMAKE_BUILD_TYPE}" _build_type)
486message(STATUS "summary of build options:
487
488    Package version: ${VERSION}
489    Library version: ${LT_CURRENT}:${LT_REVISION}:${LT_AGE}
490    Install prefix:  ${CMAKE_INSTALL_PREFIX}
491    Target system:   ${CMAKE_SYSTEM_NAME}
492    Compiler:
493      Build type:     ${CMAKE_BUILD_TYPE}
494      C compiler:     ${CMAKE_C_COMPILER}
495      CFLAGS:         ${CMAKE_C_FLAGS_${_build_type}} ${CMAKE_C_FLAGS}
496      C++ compiler:   ${CMAKE_CXX_COMPILER}
497      CXXFLAGS:       ${CMAKE_CXX_FLAGS_${_build_type}} ${CMAKE_CXX_FLAGS}
498      WARNCFLAGS:     ${WARNCFLAGS}
499      CXX1XCXXFLAGS:  ${CXX1XCXXFLAGS}
500      WARNCXXFLAGS:   ${WARNCXXFLAGS}
501    Python:
502      Python:          ${Python3_EXECUTABLE}
503      Python3_VERSION: ${Python3_VERSION}
504    Test:
505      Failmalloc:     ${ENABLE_FAILMALLOC}
506      Build Test:     ${BUILD_TESTING}
507    Libs:
508      OpenSSL:        ${HAVE_OPENSSL} (LIBS='${OPENSSL_LIBRARIES}')
509      wolfSSL:        ${HAVE_WOLFSSL} (LIBS='${WOLFSSL_LIBRARIES}')
510      Libxml2:        ${HAVE_LIBXML2} (LIBS='${LIBXML2_LIBRARIES}')
511      Libev:          ${HAVE_LIBEV} (LIBS='${LIBEV_LIBRARIES}')
512      Libc-ares:      ${HAVE_LIBCARES} (LIBS='${LIBCARES_LIBRARIES}')
513      Libngtcp2:      ${HAVE_LIBNGTCP2} (LIBS='${LIBNGTCP2_LIBRARIES}')
514      Libngtcp2_crypto_quictls: ${HAVE_LIBNGTCP2_CRYPTO_QUICTLS} (LIBS='${LIBNGTCP2_CRYPTO_QUICTLS_LIBRARIES}')
515      Libngtcp2_crypto_wolfssl: ${HAVE_LIBNGTCP2_CRYPTO_WOLFSSL} (LIBS='${LIBNGTCP2_CRYPTO_WOLFSSL_LIBRARIES}')
516      Libnghttp3:     ${HAVE_LIBNGHTTP3} (LIBS='${LIBNGHTTP3_LIBRARIES}')
517      Libbpf:         ${HAVE_LIBBPF} (LIBS='${LIBBPF_LIBRARIES}')
518      Libevent(SSL):  ${HAVE_LIBEVENT_OPENSSL} (LIBS='${LIBEVENT_OPENSSL_LIBRARIES}')
519      Jansson:        ${HAVE_JANSSON} (LIBS='${JANSSON_LIBRARIES}')
520      Jemalloc:       ${HAVE_JEMALLOC} (LIBS='${JEMALLOC_LIBRARIES}')
521      Zlib:           ${HAVE_ZLIB} (LIBS='${ZLIB_LIBRARIES}')
522      Systemd:        ${HAVE_SYSTEMD} (LIBS='${SYSTEMD_LIBRARIES}')
523      Libbrotlienc:   ${HAVE_LIBBROTLIENC} (LIBS='${LIBBROTLIENC_LIBRARIES}')
524      Libbrotlidec:   ${HAVE_LIBBROTLIDEC} (LIBS='${LIBBROTLIDEC_LIBRARIES}')
525    Third-party:
526      http-parser:    ${ENABLE_THIRD_PARTY}
527      MRuby:          ${HAVE_MRUBY}
528      Neverbleed:     ${HAVE_NEVERBLEED}
529    Features:
530      Applications:   ${ENABLE_APP}
531      HPACK tools:    ${ENABLE_HPACK_TOOLS}
532      Examples:       ${ENABLE_EXAMPLES}
533      Threading:      ${ENABLE_THREADS}
534      HTTP/3(EXPERIMENTAL): ${ENABLE_HTTP3}
535")
536if(ENABLE_LIB_ONLY_DISABLED_OTHERS)
537  message("Only the library will be built. To build other components "
538    "(such as applications and examples), set ENABLE_LIB_ONLY=OFF.")
539endif()
540