Upgrade to 1.46.0
[platform/upstream/nghttp2.git] / CMakeLists.txt
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
25 cmake_minimum_required(VERSION 3.0)
26 # XXX using 1.8.90 instead of 1.9.0-DEV
27 project(nghttp2 VERSION 1.46.0)
28
29 # See versioning rule:
30 #  https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
31 set(LT_CURRENT  35)
32 set(LT_REVISION 1)
33 set(LT_AGE      21)
34
35 set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
36 include(Version)
37
38 math(EXPR LT_SOVERSION "${LT_CURRENT} - ${LT_AGE}")
39 set(LT_VERSION "${LT_SOVERSION}.${LT_AGE}.${LT_REVISION}")
40 set(PACKAGE_VERSION     "${PROJECT_VERSION}")
41 HexVersion(PACKAGE_VERSION_NUM ${PROJECT_VERSION_MAJOR} ${PROJECT_VERSION_MINOR} ${PROJECT_VERSION_PATCH})
42
43 if(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")
51 endif()
52
53 include(GNUInstallDirs)
54
55 # For Python bindings and documentation
56 # (Must be called before PythonLibs for matching versions.)
57 find_package(PythonInterp)
58
59 # Auto-detection of features that can be toggled
60 find_package(OpenSSL 1.0.1)
61 find_package(Libev 4.11)
62 find_package(Libcares 1.7.5)
63 find_package(ZLIB 1.2.3)
64 find_package(Libngtcp2 0.0.0)
65 find_package(Libngtcp2_crypto_openssl 0.0.0)
66 if(LIBNGTCP2_CRYPTO_OPENSSL_FOUND)
67   set(HAVE_LIBNGTCP2_CRYPTO_OPENSSL 1)
68 endif()
69 find_package(Libnghttp3 0.0.0)
70 find_package(Libbpf 0.4.0)
71 if(OPENSSL_FOUND AND LIBEV_FOUND AND ZLIB_FOUND)
72   set(ENABLE_APP_DEFAULT ON)
73 else()
74   set(ENABLE_APP_DEFAULT OFF)
75 endif()
76 find_package(Systemd 209)
77 find_package(Jansson  2.5)
78 set(ENABLE_HPACK_TOOLS_DEFAULT ${JANSSON_FOUND})
79 # 2.0.8 is required because we use evconnlistener_set_error_cb()
80 find_package(Libevent 2.0.8 COMPONENTS libevent openssl)
81 set(ENABLE_EXAMPLES_DEFAULT ${LIBEVENT_OPENSSL_FOUND})
82 find_package(Cython)
83 find_package(PythonLibs)
84 if(CYTHON_FOUND AND PYTHONLIBS_FOUND)
85   set(ENABLE_PYTHON_BINDINGS_DEFAULT ON)
86 else()
87   set(ENABLE_PYTHON_BINDINGS_DEFAULT OFF)
88 endif()
89
90 find_package(LibXml2 2.6.26)
91 set(WITH_LIBXML2_DEFAULT    ${LIBXML2_FOUND})
92 find_package(Jemalloc)
93 set(WITH_JEMALLOC_DEFAULT   ${JEMALLOC_FOUND})
94
95 include(CMakeOptions.txt)
96
97 if(ENABLE_LIB_ONLY AND (ENABLE_APP OR ENABLE_HPACK_TOOLS OR ENABLE_EXAMPLES OR
98   ENABLE_PYTHON_BINDINGS))
99   # Remember when disabled options are disabled for later diagnostics.
100   set(ENABLE_LIB_ONLY_DISABLED_OTHERS 1)
101 else()
102   set(ENABLE_LIB_ONLY_DISABLED_OTHERS 0)
103 endif()
104 if(ENABLE_LIB_ONLY)
105   set(ENABLE_APP            OFF)
106   set(ENABLE_HPACK_TOOLS    OFF)
107   set(ENABLE_EXAMPLES       OFF)
108   set(ENABLE_PYTHON_BINDINGS OFF)
109 endif()
110
111 # Do not disable assertions based on CMAKE_BUILD_TYPE.
112 foreach(_build_type "Release" "MinSizeRel" "RelWithDebInfo")
113   foreach(_lang C CXX)
114     string(TOUPPER "CMAKE_${_lang}_FLAGS_${_build_type}" _var)
115     string(REGEX REPLACE "(^| )[/-]D *NDEBUG($| )" " " ${_var} "${${_var}}")
116   endforeach()
117 endforeach()
118
119 if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
120   set(HINT_NORETURN       "__attribute__((noreturn))")
121 else()
122   set(HINT_NORETURN)
123 endif()
124
125 include(ExtractValidFlags)
126 foreach(_cxx1x_flag -std=c++14)
127   extract_valid_cxx_flags(_cxx1x_flag_supported ${_cxx1x_flag})
128   if(_cxx1x_flag_supported)
129     set(CXX1XCXXFLAGS ${_cxx1x_flag})
130     break()
131   endif()
132 endforeach()
133
134 include(CMakePushCheckState)
135 include(CheckCXXSourceCompiles)
136 cmake_push_check_state()
137 set(CMAKE_REQUIRED_DEFINITIONS "${CXX1XCXXFLAGS}")
138 # Check that std::future is available.
139 check_cxx_source_compiles("
140 #include <vector>
141 #include <future>
142 int main() { std::vector<std::future<int>> v; }" HAVE_STD_FUTURE)
143 # Check that std::map::emplace is available for g++-4.7.
144 check_cxx_source_compiles("
145 #include <map>
146 int main() { std::map<int, int>().emplace(1, 2); }" HAVE_STD_MAP_EMPLACE)
147 cmake_pop_check_state()
148
149
150 # Checks for libraries.
151 # Additional libraries required for programs under src directory.
152 set(APP_LIBRARIES)
153
154 if(ENABLE_PYTHON_BINDINGS)
155   if(NOT (CYTHON_FOUND AND PYTHONLIBS_FOUND))
156     message(FATAL_ERROR "python bindings were requested "
157       "(ENABLE_PYTHON_BINDINGS=1) but dependencies are not met.")
158   endif()
159   if(NOT PYTHON_VERSION_STRING STREQUAL PYTHONLIBS_VERSION_STRING)
160     message(FATAL_ERROR
161       "Python executable and library must have the same version!"
162       " Found Python ${PYTHON_VERSION_STRING} and"
163       " PythonLibs ${PYTHONLIBS_VERSION_STRING}"
164     )
165   endif()
166 endif()
167
168 set(CMAKE_THREAD_PREFER_PTHREAD 1)
169 find_package(Threads)
170 if(CMAKE_USE_PTHREADS_INIT)
171   list(APPEND APP_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
172 endif()
173 # XXX android and C++, is this still needed in cmake?
174 # case "$host" in
175 #   *android*)
176 #     android_build=yes
177 #     # android does not need -pthread, but needs followng 3 libs for C++
178 #     APPLDFLAGS="$APPLDFLAGS -lstdc++ -latomic -lsupc++"
179
180 # dl: openssl requires libdl when it is statically linked.
181 # XXX shouldn't ${CMAKE_DL_LIBS} be appended to OPENSSL_LIBRARIES instead of
182 # APP_LIBRARIES if it is really specific to OpenSSL?
183
184 find_package(CUnit 2.1)
185 enable_testing()
186 set(HAVE_CUNIT      ${CUNIT_FOUND})
187 if(HAVE_CUNIT)
188   add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
189 endif()
190
191 # openssl (for src)
192 include(CheckSymbolExists)
193 set(HAVE_OPENSSL    ${OPENSSL_FOUND})
194 if(OPENSSL_FOUND)
195   set(OPENSSL_INCLUDE_DIRS  ${OPENSSL_INCLUDE_DIR})
196   cmake_push_check_state()
197   set(CMAKE_REQUIRED_INCLUDES   "${OPENSSL_INCLUDE_DIR}")
198   set(CMAKE_REQUIRED_LIBRARIES  "${OPENSSL_LIBRARIES}")
199   check_symbol_exists(SSL_is_quic "openssl/ssl.h" HAVE_SSL_IS_QUIC)
200   if(NOT HAVE_SSL_IS_QUIC)
201     message(WARNING "OpenSSL in ${OPENSSL_LIBRARIES} dose not have SSL_is_quic.  HTTP/3 support cannot be enabled")
202   endif()
203   cmake_pop_check_state()
204 else()
205   set(OPENSSL_INCLUDE_DIRS  "")
206   set(OPENSSL_LIBRARIES     "")
207 endif()
208 # libev (for src)
209 set(HAVE_LIBEV      ${LIBEV_FOUND})
210 set(HAVE_ZLIB       ${ZLIB_FOUND})
211 set(HAVE_SYSTEMD    ${SYSTEMD_FOUND})
212 set(HAVE_LIBEVENT_OPENSSL ${LIBEVENT_FOUND})
213 if(LIBEVENT_FOUND)
214   # Must both link the core and openssl libraries.
215   set(LIBEVENT_OPENSSL_LIBRARIES ${LIBEVENT_LIBRARIES})
216 endif()
217 # libc-ares (for src)
218 set(HAVE_LIBCARES   ${LIBCARES_FOUND})
219 if(LIBCARES_FOUND)
220   set(LIBCARES_INCLUDE_DIRS ${LIBCARES_INCLUDE_DIR})
221 else()
222   set(LIBCARES_INCLUDE_DIRS "")
223   set(LIBCARES_LIBRARIES    "")
224 endif()
225 # jansson (for src/nghttp, src/deflatehd and src/inflatehd)
226 set(HAVE_JANSSON    ${JANSSON_FOUND})
227 # libxml2 (for src/nghttp)
228 set(HAVE_LIBXML2    ${LIBXML2_FOUND})
229 if(LIBXML2_FOUND)
230   set(LIBXML2_INCLUDE_DIRS  ${LIBXML2_INCLUDE_DIR})
231 else()
232   set(LIBXML2_INCLUDE_DIRS  "")
233   set(LIBXML2_LIBRARIES     "")
234 endif()
235 # jemalloc
236 set(HAVE_JEMALLOC   ${JEMALLOC_FOUND})
237
238 if(ENABLE_ASIO_LIB)
239   find_package(Boost 1.54.0 REQUIRED system thread)
240 endif()
241
242 # libbpf (for bpf)
243 set(HAVE_LIBBPF ${LIBBPF_FOUND})
244 if(LIBBPF_FOUND)
245   set(BPFCFLAGS -Wall -O2 -g)
246   if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
247     # For Debian/Ubuntu
248     set(EXTRABPFCFLAGS -I/usr/include/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu)
249   endif()
250
251   check_c_source_compiles("
252 #include <linux/bpf.h>
253 int main() { enum bpf_stats_type foo; (void)foo; }" HAVE_BPF_STATS_TYPE)
254 endif()
255
256 # The nghttp, nghttpd and nghttpx under src depend on zlib, OpenSSL and libev
257 if(ENABLE_APP AND NOT (ZLIB_FOUND AND OPENSSL_FOUND AND LIBEV_FOUND))
258   message(FATAL_ERROR "Applications were requested (ENABLE_APP=1) but dependencies are not met.")
259 endif()
260
261 # HTTP/3 requires quictls/openssl, libngtcp2, libngtcp2_crypto_openssl
262 # and libnghttp3.
263 if(ENABLE_HTTP3 AND NOT (HAVE_SSL_IS_QUIC AND LIBNGTCP2_FOUND AND LIBNGTCP2_CRYPTO_OPENSSL_FOUND AND LIBNGHTTP3_FOUND))
264   message(FATAL_ERROR "HTTP/3 was requested (ENABLE_HTTP3=1) but dependencies are not met.")
265 endif()
266
267 # HPACK tools requires jansson
268 if(ENABLE_HPACK_TOOLS AND NOT HAVE_JANSSON)
269   message(FATAL_ERROR "HPACK tools were requested (ENABLE_HPACK_TOOLS=1) but dependencies are not met.")
270 endif()
271
272 # C++ library libnghttp2_asio
273 if(ENABLE_EXAMPLES AND NOT (OPENSSL_FOUND AND LIBEVENT_OPENSSL_FOUND))
274   message(FATAL_ERROR "examples were requested (ENABLE_EXAMPLES=1) but dependencies are not met.")
275 endif()
276
277 # third-party http-parser only be built when needed
278 if(ENABLE_EXAMPLES OR ENABLE_APP OR ENABLE_HPACK_TOOLS OR ENABLE_ASIO_LIB)
279   set(ENABLE_THIRD_PARTY 1)
280   # mruby (for src/nghttpx)
281   set(HAVE_MRUBY      ${WITH_MRUBY})
282   set(HAVE_NEVERBLEED ${WITH_NEVERBLEED})
283 else()
284   set(HAVE_MRUBY 0)
285   set(HAVE_NEVERBLEED 0)
286 endif()
287
288 # Checks for header files.
289 include(CheckIncludeFile)
290 check_include_file("arpa/inet.h"    HAVE_ARPA_INET_H)
291 check_include_file("fcntl.h"        HAVE_FCNTL_H)
292 check_include_file("inttypes.h"     HAVE_INTTYPES_H)
293 check_include_file("limits.h"       HAVE_LIMITS_H)
294 check_include_file("netdb.h"        HAVE_NETDB_H)
295 check_include_file("netinet/in.h"   HAVE_NETINET_IN_H)
296 check_include_file("pwd.h"          HAVE_PWD_H)
297 check_include_file("sys/socket.h"   HAVE_SYS_SOCKET_H)
298 check_include_file("sys/time.h"     HAVE_SYS_TIME_H)
299 check_include_file("syslog.h"       HAVE_SYSLOG_H)
300 check_include_file("time.h"         HAVE_TIME_H)
301 check_include_file("unistd.h"       HAVE_UNISTD_H)
302
303 include(CheckTypeSize)
304 # Checks for typedefs, structures, and compiler characteristics.
305 # AC_TYPE_SIZE_T
306 check_type_size("ssize_t" SIZEOF_SSIZE_T)
307 if(SIZEOF_SSIZE_T STREQUAL "")
308   # ssize_t is a signed type in POSIX storing at least -1.
309   # Set it to "int" to match the behavior of AC_TYPE_SSIZE_T (autotools).
310   set(ssize_t int)
311 endif()
312 # AC_TYPE_UINT8_T
313 # AC_TYPE_UINT16_T
314 # AC_TYPE_UINT32_T
315 # AC_TYPE_UINT64_T
316 # AC_TYPE_INT8_T
317 # AC_TYPE_INT16_T
318 # AC_TYPE_INT32_T
319 # AC_TYPE_INT64_T
320 # AC_TYPE_OFF_T
321 # AC_TYPE_PID_T
322 # AC_TYPE_UID_T
323 # XXX To support inline for crappy compilers, see https://cmake.org/Wiki/CMakeTestInline
324 # AC_C_INLINE
325 # XXX is AC_SYS_LARGEFILE still needed for modern systems?
326 # add_definitions(-D_FILE_OFFSET_BITS=64)
327
328 include(CheckStructHasMember)
329 check_struct_has_member("struct tm" tm_gmtoff time.h HAVE_STRUCT_TM_TM_GMTOFF)
330
331 # Check size of pointer to decide we need 8 bytes alignment adjustment.
332 check_type_size("int *"   SIZEOF_INT_P)
333 check_type_size("time_t"  SIZEOF_TIME_T)
334
335 # Checks for library functions.
336 include(CheckFunctionExists)
337 check_function_exists(_Exit     HAVE__EXIT)
338 check_function_exists(accept4   HAVE_ACCEPT4)
339 check_function_exists(mkostemp  HAVE_MKOSTEMP)
340
341 include(CheckSymbolExists)
342 # XXX does this correctly detect initgroups (un)availability on cygwin?
343 check_symbol_exists(initgroups grp.h HAVE_DECL_INITGROUPS)
344 if(NOT HAVE_DECL_INITGROUPS AND HAVE_UNISTD_H)
345   # FreeBSD declares initgroups() in unistd.h
346   check_symbol_exists(initgroups unistd.h HAVE_DECL_INITGROUPS2)
347   if(HAVE_DECL_INITGROUPS2)
348     set(HAVE_DECL_INITGROUPS 1)
349   endif()
350 endif()
351
352 set(WARNCFLAGS)
353 set(WARNCXXFLAGS)
354 if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
355   if(ENABLE_WERROR)
356     set(WARNCFLAGS    /WX)
357     set(WARNCXXFLAGS  /WX)
358   endif()
359 else()
360   if(ENABLE_WERROR)
361     extract_valid_c_flags(WARNCFLAGS    -Werror)
362     extract_valid_c_flags(WARNCXXFLAGS  -Werror)
363   endif()
364
365   # For C compiler
366   extract_valid_c_flags(WARNCFLAGS
367     -Wall
368     -Wextra
369     -Wmissing-prototypes
370     -Wstrict-prototypes
371     -Wmissing-declarations
372     -Wpointer-arith
373     -Wdeclaration-after-statement
374     -Wformat-security
375     -Wwrite-strings
376     -Wshadow
377     -Winline
378     -Wnested-externs
379     -Wfloat-equal
380     -Wundef
381     -Wendif-labels
382     -Wempty-body
383     -Wcast-align
384     -Wclobbered
385     -Wvla
386     -Wpragmas
387     -Wunreachable-code
388     -Waddress
389     -Wattributes
390     -Wdiv-by-zero
391     -Wshorten-64-to-32
392
393     -Wconversion
394     -Wextended-offsetof
395     -Wformat-nonliteral
396     -Wlanguage-extension-token
397     -Wmissing-field-initializers
398     -Wmissing-noreturn
399     -Wmissing-variable-declarations
400     # Not used because we cannot change public structs
401     # -Wpadded
402     -Wsign-conversion
403     # Not used because this basically disallows default case
404     # -Wswitch-enum
405     -Wunreachable-code-break
406     -Wunused-macros
407     -Wunused-parameter
408     -Wredundant-decls
409     # Only work with Clang for the moment
410     -Wheader-guard
411     # This is required because we pass format string as "const char*.
412     -Wno-format-nonliteral
413   )
414
415   extract_valid_cxx_flags(WARNCXXFLAGS
416     # For C++ compiler
417     -Wall
418     -Wformat-security
419   )
420 endif()
421
422 if(ENABLE_STATIC_CRT)
423   foreach(lang C CXX)
424     foreach(suffix "" _DEBUG _MINSIZEREL _RELEASE _RELWITHDEBINFO)
425       set(var "CMAKE_${lang}_FLAGS${suffix}")
426       string(REPLACE "/MD" "/MT" ${var} "${${var}}")
427     endforeach()
428   endforeach()
429 endif()
430
431 if(ENABLE_DEBUG)
432   set(DEBUGBUILD 1)
433 endif()
434
435 # Some platform does not have working std::future.  We disable
436 # threading for those platforms.
437 if(NOT ENABLE_THREADS OR NOT HAVE_STD_FUTURE)
438   set(NOTHREADS 1)
439 endif()
440
441 add_definitions(-DHAVE_CONFIG_H)
442 configure_file(cmakeconfig.h.in config.h)
443 # autotools-compatible names
444 # Sphinx expects relative paths in the .rst files. Use the fact that the files
445 # below are all one directory level deep.
446 file(RELATIVE_PATH top_srcdir   "${CMAKE_CURRENT_BINARY_DIR}/dir" "${CMAKE_CURRENT_SOURCE_DIR}")
447 file(RELATIVE_PATH top_builddir "${CMAKE_CURRENT_BINARY_DIR}/dir" "${CMAKE_CURRENT_BINARY_DIR}")
448 set(abs_top_srcdir  "${CMAKE_CURRENT_SOURCE_DIR}")
449 set(abs_top_builddir "${CMAKE_CURRENT_BINARY_DIR}")
450 # libnghttp2.pc (pkg-config file)
451 set(prefix          "${CMAKE_INSTALL_PREFIX}")
452 set(exec_prefix     "${CMAKE_INSTALL_PREFIX}")
453 set(libdir          "${CMAKE_INSTALL_FULL_LIBDIR}")
454 set(includedir      "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
455 set(VERSION         "${PACKAGE_VERSION}")
456 # For init scripts and systemd service file (in contrib/)
457 set(bindir          "${CMAKE_INSTALL_FULL_BINDIR}")
458 set(sbindir         "${CMAKE_INSTALL_FULL_SBINDIR}")
459 foreach(name
460    lib/libnghttp2.pc
461    lib/includes/nghttp2/nghttp2ver.h
462    src/libnghttp2_asio.pc
463    python/setup.py
464    integration-tests/config.go
465    integration-tests/setenv
466    doc/conf.py
467    doc/index.rst
468    doc/package_README.rst
469    doc/tutorial-client.rst
470    doc/tutorial-server.rst
471    doc/tutorial-hpack.rst
472    doc/nghttpx-howto.rst
473    doc/h2load-howto.rst
474    doc/libnghttp2_asio.rst
475    doc/python-apiref.rst
476    doc/building-android-binary.rst
477    doc/nghttp2.h.rst
478    doc/nghttp2ver.h.rst
479    doc/asio_http2.h.rst
480    doc/asio_http2_server.h.rst
481    doc/asio_http2_client.h.rst
482    doc/contribute.rst
483 )
484   configure_file("${name}.in" "${name}" @ONLY)
485 endforeach()
486
487 if(APPLE)
488   add_definitions(-D__APPLE_USE_RFC_3542)
489 endif()
490
491 include_directories(
492   "${CMAKE_CURRENT_BINARY_DIR}" # for config.h
493 )
494 # For use in src/CMakeLists.txt
495 set(PKGDATADIR "${CMAKE_INSTALL_FULL_DATADIR}/${CMAKE_PROJECT_NAME}")
496 set(PKGLIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}/${CMAKE_PROJECT_NAME}")
497
498 install(FILES README.rst DESTINATION "${CMAKE_INSTALL_DOCDIR}")
499
500 add_subdirectory(lib)
501 #add_subdirectory(lib/includes)
502 add_subdirectory(third-party)
503 add_subdirectory(src)
504 #add_subdirectory(src/includes)
505 add_subdirectory(examples)
506 add_subdirectory(python)
507 add_subdirectory(tests)
508 #add_subdirectory(tests/testdata)
509 add_subdirectory(integration-tests)
510 add_subdirectory(doc)
511 add_subdirectory(contrib)
512 add_subdirectory(script)
513 add_subdirectory(bpf)
514
515
516 string(TOUPPER "${CMAKE_BUILD_TYPE}" _build_type)
517 message(STATUS "summary of build options:
518
519     Package version: ${VERSION}
520     Library version: ${LT_CURRENT}:${LT_REVISION}:${LT_AGE}
521     Install prefix:  ${CMAKE_INSTALL_PREFIX}
522     Target system:   ${CMAKE_SYSTEM_NAME}
523     Compiler:
524       Build type:     ${CMAKE_BUILD_TYPE}
525       C compiler:     ${CMAKE_C_COMPILER}
526       CFLAGS:         ${CMAKE_C_FLAGS_${_build_type}} ${CMAKE_C_FLAGS}
527       C++ compiler:   ${CMAKE_CXX_COMPILER}
528       CXXFLAGS:       ${CMAKE_CXX_FLAGS_${_build_type}} ${CMAKE_CXX_FLAGS}
529       WARNCFLAGS:     ${WARNCFLAGS}
530       CXX1XCXXFLAGS:  ${CXX1XCXXFLAGS}
531     Python:
532       Python:         ${PYTHON_EXECUTABLE}
533       PYTHON_VERSION: ${PYTHON_VERSION_STRING}
534       Library version:${PYTHONLIBS_VERSION_STRING}
535       Cython:         ${CYTHON_EXECUTABLE}
536     Test:
537       CUnit:          ${HAVE_CUNIT} (LIBS='${CUNIT_LIBRARIES}')
538       Failmalloc:     ${ENABLE_FAILMALLOC}
539     Libs:
540       OpenSSL:        ${HAVE_OPENSSL} (LIBS='${OPENSSL_LIBRARIES}')
541       Libxml2:        ${HAVE_LIBXML2} (LIBS='${LIBXML2_LIBRARIES}')
542       Libev:          ${HAVE_LIBEV} (LIBS='${LIBEV_LIBRARIES}')
543       Libc-ares:      ${HAVE_LIBCARES} (LIBS='${LIBCARES_LIBRARIES}')
544       Libngtcp2:      ${HAVE_LIBNGTCP2} (LIBS='${LIBNGTCP2_LIBRARIES}')
545       Libngtcp2_crypto_openssl: ${HAVE_LIBNGTCP2_CRYPTO_OPENSSL} (LIBS='${LIBNGTCP2_CRYPTO_OPENSSL_LIBRARIES}')
546       Libnghttp3:     ${HAVE_LIBNGHTTP3} (LIBS='${LIBNGHTTP3_LIBRARIES}')
547       Libbpf:         ${HAVE_LIBBPF} (LIBS='${LIBBPF_LIBRARIES}')
548       Libevent(SSL):  ${HAVE_LIBEVENT_OPENSSL} (LIBS='${LIBEVENT_OPENSSL_LIBRARIES}')
549       Jansson:        ${HAVE_JANSSON} (LIBS='${JANSSON_LIBRARIES}')
550       Jemalloc:       ${HAVE_JEMALLOC} (LIBS='${JEMALLOC_LIBRARIES}')
551       Zlib:           ${HAVE_ZLIB} (LIBS='${ZLIB_LIBRARIES}')
552       Systemd:        ${HAVE_SYSTEMD} (LIBS='${SYSTEMD_LIBRARIES}')
553       Boost::System:  ${Boost_SYSTEM_LIBRARY}
554       Boost::Thread:  ${Boost_THREAD_LIBRARY}
555     Third-party:
556       http-parser:    ${ENABLE_THIRD_PARTY}
557       MRuby:          ${HAVE_MRUBY}
558       Neverbleed:     ${HAVE_NEVERBLEED}
559     Features:
560       Applications:   ${ENABLE_APP}
561       HPACK tools:    ${ENABLE_HPACK_TOOLS}
562       Libnghttp2_asio:${ENABLE_ASIO_LIB}
563       Examples:       ${ENABLE_EXAMPLES}
564       Python bindings:${ENABLE_PYTHON_BINDINGS}
565       Threading:      ${ENABLE_THREADS}
566       HTTP/3(EXPERIMENTAL): ${ENABLE_HTTP3}
567 ")
568 if(ENABLE_LIB_ONLY_DISABLED_OTHERS)
569   message("Only the library will be built. To build other components "
570     "(such as applications and examples), set ENABLE_LIB_ONLY=OFF.")
571 endif()