Browse Source

Allow to set NO_CGI option for CMake

bel 10 năm trước cách đây
mục cha
commit
d14ece6c1b
2 tập tin đã thay đổi với 10 bổ sung0 xóa
  1. 7 0
      CMakeLists.txt
  2. 3 0
      appveyor.yml

+ 7 - 0
CMakeLists.txt

@@ -64,6 +64,10 @@ message(STATUS "Thread Stack Size - ${CIVETWEB_THREAD_STACK_SIZE}")
 option(CIVETWEB_SERVE_NO_FILES "Configures the server to serve no static files" OFF)
 message(STATUS "Serve no static files - ${CIVETWEB_SERVE_NO_FILES}")
 
+# Serve no files from the web server
+option(CIVETWEB_DISABLE_CGI "Disables CGI, so theserver will not execute CGI scripts" OFF)
+message(STATUS "Disable CGI support - ${CIVETWEB_DISABLE_CGI}")
+
 # C++ wrappers
 option(CIVETWEB_ENABLE_CXX "Enables the C++ wrapper library" OFF)
 message(STATUS "C++ wrappers - ${CIVETWEB_ENABLE_CXX}")
@@ -344,6 +348,9 @@ endif()
 if (CIVETWEB_SERVE_NO_FILES)
   add_definitions(-DNO_FILES)
 endif()
+if (CIVETWEB_DISABLE_CGI)
+  add_definitions(-DNO_CGI)
+endif()
 if (CIVETWEB_ENABLE_LUA)
   add_definitions(-DUSE_LUA)
 endif()

+ 3 - 0
appveyor.yml

@@ -17,6 +17,7 @@ environment:
   enable_lua_shared: NO
   c_standard: auto
   cxx_standard: auto
+  no_cgi: NO
   matrix:
     - compiler: gcc-5.1.0-posix
       build_shared: NO
@@ -74,6 +75,7 @@ before_build:
   - if "%compiler_name%"=="gcc" (set "build=mingw32-make -j4")
   - if "%compiler_name%"=="gcc" (set "test=mingw32-make CTEST_OUTPUT_ON_FAILURE=1 test")
   # MSVC specific commands
+  # Note: The minimum version officially supported for CivetWeb is VS2010. Older ones might work or not.
   - if "%compiler_version%"=="14" (set "vs_version=8" & set "vs_year=2005")
   - if "%compiler_version%"=="15" (set "vs_version=9" & set "vs_year=2008")
   - if "%compiler_version%"=="16" (set "vs_version=10" & set "vs_year=2010")
@@ -113,6 +115,7 @@ before_build:
     "-DCIVETWEB_THIRD_PARTY_DIR=%third_party_dir:\=\\%"
     -DCIVETWEB_ENABLE_THIRD_PARTY_OUTPUT=YES
     -DCIVETWEB_ENABLE_SSL=%enable_ssl%
+    -DCIVETWEB_DISABLE_CGI=%no_cgi%
     -DCIVETWEB_ENABLE_SSL_DYNAMIC_LOADING=%enable_ssl_dynamic_loading%
     -DCIVETWEB_ENABLE_WEBSOCKETS=%enable_websockets%
     -DCIVETWEB_ENABLE_CXX=%enable_cxx%