浏览代码

Merge branch 'master' of https://github.com/civetweb/civetweb

bel2125 4 年之前
父节点
当前提交
737495f268
共有 2 个文件被更改,包括 14 次插入1 次删除
  1. 8 1
      CMakeLists.txt
  2. 6 0
      src/CMakeLists.txt

+ 8 - 1
CMakeLists.txt

@@ -1,5 +1,5 @@
 # Determines what CMake APIs we can rely on
 # Determines what CMake APIs we can rely on
-cmake_minimum_required (VERSION 2.8.11)
+cmake_minimum_required (VERSION 2.8.12)
 if (${CMAKE_VERSION} VERSION_GREATER 3.2.2)
 if (${CMAKE_VERSION} VERSION_GREATER 3.2.2)
   cmake_policy(VERSION 3.2.2)
   cmake_policy(VERSION 3.2.2)
 endif()
 endif()
@@ -112,6 +112,10 @@ message(STATUS "Force x32 / x64 architecture - ${CIVETWEB_ARCH}")
 option(CIVETWEB_ENABLE_LUA "Enable Lua CGIs" OFF)
 option(CIVETWEB_ENABLE_LUA "Enable Lua CGIs" OFF)
 message(STATUS "Lua CGI support - ${CIVETWEB_ENABLE_LUA}")
 message(STATUS "Lua CGI support - ${CIVETWEB_ENABLE_LUA}")
 
 
+# zlib compression support
+option(CIVETWEB_ENABLE_ZLIB "Enables zlib compression support" OFF)
+message(STATUS "zlib support - ${CIVETWEB_ENABLE_ZLIB}")
+
 # Enable installing CivetWeb executables
 # Enable installing CivetWeb executables
 option(CIVETWEB_INSTALL_EXECUTABLE "Enable installing CivetWeb executable" ON)
 option(CIVETWEB_INSTALL_EXECUTABLE "Enable installing CivetWeb executable" ON)
 mark_as_advanced(FORCE CIVETWEB_INSTALL_EXECUTABLE) # Advanced users can disable
 mark_as_advanced(FORCE CIVETWEB_INSTALL_EXECUTABLE) # Advanced users can disable
@@ -508,6 +512,9 @@ endif()
 if (CIVETWEB_ENABLE_LUA)
 if (CIVETWEB_ENABLE_LUA)
   add_definitions(-DUSE_LUA)
   add_definitions(-DUSE_LUA)
 endif()
 endif()
+if (CIVETWEB_ENABLE_ZLIB)
+  add_definitions(-DUSE_ZLIB)
+endif()
 if (CIVETWEB_ENABLE_DUKTAPE)
 if (CIVETWEB_ENABLE_DUKTAPE)
   add_definitions(-DUSE_DUKTAPE)
   add_definitions(-DUSE_DUKTAPE)
 endif()
 endif()

+ 6 - 0
src/CMakeLists.txt

@@ -246,6 +246,12 @@ if (CIVETWEB_ENABLE_LUA)
   target_link_libraries(civetweb-c-library ${LUA_LIBRARIES})
   target_link_libraries(civetweb-c-library ${LUA_LIBRARIES})
 endif()
 endif()
 
 
+if (CIVETWEB_ENABLE_ZLIB)
+  find_package(ZLIB)
+  include_directories(${ZLIB_INCLUDE_DIRS})
+  target_link_libraries(civetweb-c-library ${ZLIB_LIBRARIES})
+endif()
+
 # The web server executable
 # The web server executable
 if (CIVETWEB_ENABLE_SERVER_EXECUTABLE)
 if (CIVETWEB_ENABLE_SERVER_EXECUTABLE)
     add_executable(civetweb-c-executable main.c)
     add_executable(civetweb-c-executable main.c)