]> granicus.if.org Git - apache/blobdiff - CMakeLists.txt
XML updates.
[apache] / CMakeLists.txt
index 1f06ed2ea6327dca5ed310e56bf1abd942015432..47fe79e4d7581ba9634b73445896f6d3216c02a7 100644 (file)
@@ -58,6 +58,18 @@ ELSE()
   SET(default_nghttp2_libraries "${CMAKE_INSTALL_PREFIX}/lib/nghttp2.lib")
 ENDIF()
 
+IF(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/brotlienc.lib")
+  SET(default_brotli_libraries "${CMAKE_INSTALL_PREFIX}/lib/brotlienc.lib" "${CMAKE_INSTALL_PREFIX}/lib/brotlicommon.lib")
+ELSE()
+  SET(default_brotli_libraries)
+ENDIF()
+
+IF(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/check.lib")
+  SET(default_check_libraries "${CMAKE_INSTALL_PREFIX}/lib/check.lib" "${CMAKE_INSTALL_PREFIX}/lib/compat.lib")
+ELSE()
+  SET(default_check_libraries)
+ENDIF()
+
 SET(APR_INCLUDE_DIR       "${CMAKE_INSTALL_PREFIX}/include" CACHE STRING "Directory with APR[-Util] include files")
 SET(APR_LIBRARIES         ${default_apr_libraries}       CACHE STRING "APR libraries to link with")
 SET(NGHTTP2_INCLUDE_DIR   "${CMAKE_INSTALL_PREFIX}/include" CACHE STRING "Directory with NGHTTP2 include files within nghttp2 subdirectory")
@@ -66,6 +78,10 @@ SET(PCRE_INCLUDE_DIR      "${CMAKE_INSTALL_PREFIX}/include" CACHE STRING "Direct
 SET(PCRE_LIBRARIES        ${default_pcre_libraries}      CACHE STRING "PCRE libraries to link with")
 SET(LIBXML2_ICONV_INCLUDE_DIR     ""                     CACHE STRING "Directory with iconv include files for libxml2")
 SET(LIBXML2_ICONV_LIBRARIES       ""                     CACHE STRING "iconv libraries to link with for libxml2")
+SET(BROTLI_INCLUDE_DIR    "${CMAKE_INSTALL_PREFIX}/include" CACHE STRING "Directory with include files for Brotli")
+SET(BROTLI_LIBRARIES      ${default_brotli_libraries}    CACHE STRING "Brotli libraries to link with")
+SET(CHECK_INCLUDE_DIR     "${CMAKE_INSTALL_PREFIX}/include" CACHE STRING "Directory with include files for Check")
+SET(CHECK_LIBRARIES       "${default_check_libraries}"   CACHE STRING "Check libraries to link with")
 # end support library configuration
 
 # Misc. options
@@ -191,6 +207,30 @@ ELSE()
   SET(NGHTTP2_FOUND FALSE)
 ENDIF()
 
+# See if we have Brotli
+SET(BROTLI_FOUND TRUE)
+IF(EXISTS "${BROTLI_INCLUDE_DIR}/brotli/encode.h")
+  FOREACH(onelib ${BROTLI_LIBRARIES})
+    IF(NOT EXISTS ${onelib})
+      SET(BROTLI_FOUND FALSE)
+    ENDIF()
+  ENDFOREACH()
+ELSE()
+  SET(BROTLI_FOUND FALSE)
+ENDIF()
+
+# See if we have Check
+SET(CHECK_FOUND TRUE)
+IF (EXISTS "${CHECK_INCLUDE_DIR}/check.h")
+  FOREACH(onelib ${CHECK_LIBRARIES})
+    IF(NOT EXISTS "${onelib}")
+      SET(CHECK_FOUND FALSE)
+    ENDIF()
+  ENDFOREACH()
+ELSE()
+  SET(CHECK_FOUND FALSE)
+ENDIF()
+
 MESSAGE(STATUS "")
 MESSAGE(STATUS "Summary of feature detection:")
 MESSAGE(STATUS "")
@@ -199,6 +239,8 @@ MESSAGE(STATUS "LUA51_FOUND .............. : ${LUA51_FOUND}")
 MESSAGE(STATUS "NGHTTP2_FOUND ............ : ${NGHTTP2_FOUND}")
 MESSAGE(STATUS "OPENSSL_FOUND ............ : ${OPENSSL_FOUND}")
 MESSAGE(STATUS "ZLIB_FOUND ............... : ${ZLIB_FOUND}")
+MESSAGE(STATUS "BROTLI_FOUND ............. : ${BROTLI_FOUND}")
+MESSAGE(STATUS "CHECK_FOUND .............. : ${CHECK_FOUND}")
 MESSAGE(STATUS "APR_HAS_LDAP ............. : ${APR_HAS_LDAP}")
 MESSAGE(STATUS "APR_HAS_XLATE ............ : ${APR_HAS_XLATE}")
 MESSAGE(STATUS "APU_HAVE_CRYPTO .......... : ${APU_HAVE_CRYPTO}")
@@ -257,6 +299,7 @@ SET(MODULE_LIST
   "modules/cache/mod_socache_dc+O+distcache small object cache provider"
   "modules/cache/mod_socache_memcache+I+memcache small object cache provider"
   "modules/cache/mod_socache_shmcb+I+ shmcb small object cache provider"
+  "modules/cache/mod_socache_redis+I+redis small object cache provider"
   "modules/cluster/mod_heartbeat+I+Generates Heartbeats"
   "modules/cluster/mod_heartmonitor+I+Collects Heartbeats"
   "modules/core/mod_macro+I+Define and use macros in configuration files"
@@ -273,6 +316,7 @@ SET(MODULE_LIST
   "modules/examples/mod_case_filter_in+O+Example uppercase conversion input filter"
   "modules/examples/mod_example_hooks+O+Example hook callback handler module"
   "modules/examples/mod_example_ipc+O+Example of shared memory and mutex usage"
+  "modules/filters/mod_brotli+i+Brotli compression support"
   "modules/filters/mod_buffer+I+Filter Buffering"
   "modules/filters/mod_charset_lite+i+character set translation"
   "modules/filters/mod_data+O+RFC2397 data encoder"
@@ -393,6 +437,11 @@ IF(ZLIB_FOUND)
   SET(mod_deflate_extra_includes       ${ZLIB_INCLUDE_DIR})
   SET(mod_deflate_extra_libs           ${ZLIB_LIBRARIES})
 ENDIF()
+SET(mod_brotli_requires              BROTLI_FOUND)
+IF(BROTLI_FOUND)
+  SET(mod_brotli_extra_includes        ${BROTLI_INCLUDE_DIR})
+  SET(mod_brotli_extra_libs            ${BROTLI_LIBRARIES})
+ENDIF()
 SET(mod_firehose_requires            SOMEONE_TO_MAKE_IT_COMPILE_ON_WINDOWS)
 SET(mod_heartbeat_extra_libs         mod_watchdog)
 SET(mod_http2_requires               NGHTTP2_FOUND)
@@ -400,18 +449,18 @@ SET(mod_http2_extra_defines          ssize_t=long)
 SET(mod_http2_extra_includes         ${NGHTTP2_INCLUDE_DIR})
 SET(mod_http2_extra_libs             ${NGHTTP2_LIBRARIES})
 SET(mod_http2_extra_sources
-  modules/http2/h2_alt_svc.c         modules/http2/h2_bucket_eoc.c
+  modules/http2/h2_alt_svc.c
   modules/http2/h2_bucket_eos.c      modules/http2/h2_config.c
   modules/http2/h2_conn.c            modules/http2/h2_conn_io.c
   modules/http2/h2_ctx.c             modules/http2/h2_filter.c
   modules/http2/h2_from_h1.c         modules/http2/h2_h2.c
   modules/http2/h2_bucket_beam.c
   modules/http2/h2_mplx.c            modules/http2/h2_push.c
-  modules/http2/h2_request.c         modules/http2/h2_response.c
+  modules/http2/h2_request.c         modules/http2/h2_headers.c
   modules/http2/h2_session.c         modules/http2/h2_stream.c 
   modules/http2/h2_switch.c          modules/http2/h2_ngn_shed.c 
   modules/http2/h2_task.c            modules/http2/h2_util.c
-  modules/http2/h2_worker.c          modules/http2/h2_workers.c
+  modules/http2/h2_workers.c
 )
 SET(mod_ldap_extra_defines           LDAP_DECLARE_EXPORT)
 SET(mod_ldap_extra_libs              wldap32)
@@ -630,6 +679,7 @@ SET(LIBHTTPD_SOURCES
   server/util.c
   server/util_cfgtree.c
   server/util_cookies.c
+  server/util_debug.c
   server/util_expr_eval.c
   server/util_expr_parse.c
   server/util_fcgi.c
@@ -856,6 +906,50 @@ IF(OPENSSL_FOUND)
 ENDIF()
 GET_PROPERTY(tmp_includes TARGET ab PROPERTY INCLUDE_DIRECTORIES)
 
+# Unit Test Suite
+IF(CHECK_FOUND)
+  # Get all of the test cases.
+  # XXX Per CMake documentation, if a test case is added or removed we must
+  # re-run CMake due to our use of GLOB. TBD if this tradeoff to have
+  # "plug-and-play" test cases is really worth it.
+  FILE(GLOB httpdunit_cases "${CMAKE_SOURCE_DIR}/test/unit/*.c")
+
+  ADD_EXECUTABLE(httpdunit
+                   test/httpdunit.c
+                   ${httpdunit_cases})
+  SET_TARGET_PROPERTIES(httpdunit PROPERTIES
+                        INCLUDE_DIRECTORIES "${HTTPD_INCLUDE_DIRECTORIES} ${CHECK_INCLUDE_DIR}"
+                        # FIXME why does Check need HAVE_STDINT_H on Windows?
+                        COMPILE_FLAGS "-DHAVE_STDINT_H")
+  TARGET_LINK_LIBRARIES(httpdunit libhttpd ${APR_LIBRARIES} ${CHECK_LIBRARIES})
+
+  # Rules for generating the .tests stubs.
+  FILE(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/httpdunit_gen_stubs.bat"
+                CONTENT "perl \"${CMAKE_SOURCE_DIR}/build/httpdunit_gen_stubs.pl\" < %1 > %2")
+  FILE(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/test/unit")
+
+  FOREACH(case ${httpdunit_cases})
+    STRING(REGEX REPLACE "^${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}"
+                 stub "${case}")
+    STRING(REGEX REPLACE "\\.c$" ".tests"
+                 stub "${stub}")
+
+    ADD_CUSTOM_COMMAND(TARGET httpdunit
+                       PRE_BUILD
+                       COMMAND "${CMAKE_BINARY_DIR}/httpdunit_gen_stubs.bat" "\"${case}\"" "\"${stub}\""
+                       BYPRODUCTS "${stub}")
+  ENDFOREACH()
+
+  # Rule for generating the .cases file.
+  FILE(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/httpdunit_gen_cases.bat"
+                CONTENT "type \"${CMAKE_SOURCE_DIR}\"\\test\\unit\\*.c 2>NUL | perl \"${CMAKE_SOURCE_DIR}/build/httpdunit_gen_cases.pl\" --declaration > \"${CMAKE_BINARY_DIR}/test/httpdunit.cases\"
+                         type \"${CMAKE_SOURCE_DIR}\"\\test\\unit\\*.c 2>NUL | perl \"${CMAKE_SOURCE_DIR}/build/httpdunit_gen_cases.pl\" >> \"${CMAKE_BINARY_DIR}/test/httpdunit.cases\"")
+  ADD_CUSTOM_COMMAND(TARGET httpdunit
+                     PRE_BUILD
+                     COMMAND "${CMAKE_BINARY_DIR}/httpdunit_gen_cases.bat"
+                     BYPRODUCTS "${CMAKE_BINARY_DIR}/test/httpdunit.cases")
+ENDIF()
+
 # getting duplicate manifest error with ApacheMonitor
 # ADD_EXECUTABLE(ApacheMonitor support/win32/ApacheMonitor.c support/win32/ApacheMonitor.rc)
 # SET(install_targets ${install_targets} ApacheMonitor)
@@ -961,6 +1055,10 @@ MESSAGE(STATUS "  PCRE include directory .......... : ${PCRE_INCLUDE_DIR}")
 MESSAGE(STATUS "  PCRE libraries .................. : ${PCRE_LIBRARIES}")
 MESSAGE(STATUS "  libxml2 iconv prereq include dir. : ${LIBXML2_ICONV_INCLUDE_DIR}")
 MESSAGE(STATUS "  libxml2 iconv prereq libraries .. : ${LIBXML2_ICONV_LIBRARIES}")
+MESSAGE(STATUS "  Brotli include directory......... : ${BROTLI_INCLUDE_DIR}")
+MESSAGE(STATUS "  Brotli libraries ................ : ${BROTLI_LIBRARIES}")
+MESSAGE(STATUS "  Check include directory.......... : ${CHECK_INCLUDE_DIR}")
+MESSAGE(STATUS "  Check libraries ................. : ${CHECK_LIBRARIES}")
 MESSAGE(STATUS "  Extra include directories ....... : ${EXTRA_INCLUDES}")
 MESSAGE(STATUS "  Extra compile flags ............. : ${EXTRA_COMPILE_FLAGS}")
 MESSAGE(STATUS "  Extra libraries ................. : ${EXTRA_LIBS}")