summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorIvan Zhakov <ivan@apache.org>2024-07-20 18:18:18 +0200
committerIvan Zhakov <ivan@apache.org>2024-07-20 18:18:18 +0200
commit55c5d07a2d56109b7edaf399fbeabaf4dfaf6264 (patch)
treefbb3b3547a0041aaec5e01b42db4166c6087c1e1 /CMakeLists.txt
parent* .github/workflows/windows.yml: Enable VCPKG artifacts caching. (diff)
downloadapache2-55c5d07a2d56109b7edaf399fbeabaf4dfaf6264.tar.xz
apache2-55c5d07a2d56109b7edaf399fbeabaf4dfaf6264.zip
Remove awk dependency when building using CMake. Before this awk was required
for -DWITH_MODULES option. * build/build-modules-c.cmake: (generate_builtin_modules_c): Function to generate modules.c. * CMakeLists.txt (): Use generate_builtin_modules_c() instead of `awk -f build/build-modules-c.awk` to generate modules.c file. * README.cmake: (Prerequisites, How to build): Do not mention awk as prerequisite. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1919413 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt31
1 files changed, 13 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 91260d62c7..649d474ec9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,6 +23,7 @@ PROJECT(HTTPD C)
INCLUDE(CheckSymbolExists)
INCLUDE(CheckCSourceCompiles)
+INCLUDE("build/build-modules-c.cmake")
FIND_PACKAGE(LibXml2)
FIND_PACKAGE(Lua51)
@@ -656,26 +657,20 @@ SET(install_targets)
SET(install_bin_pdb)
SET(install_modules) # special handling vs. other installed targets
SET(install_modules_pdb)
-SET(builtin_module_shortnames "win32 mpm_winnt http so") # core added automatically
+SET(builtin_module_shortnames)
+LIST(APPEND builtin_module_shortnames "win32" "mpm_winnt" "http" "so") # core added automatically
SET(extra_builtin_modules) # the ones specified with -DWITH_MODULES=
-IF(WITH_MODULES) # modules statically linked with the server
- STRING(REPLACE "," ";" WITH_MODULE_LIST ${WITH_MODULES})
- FOREACH(static_mod ${WITH_MODULE_LIST})
- STRING(REGEX MATCH "[^/]+\\.c" mod_basename ${static_mod})
- STRING(REGEX REPLACE "^mod_(.*)\\.c" "\\1" mod_module_name ${mod_basename})
- SET(builtin_module_shortnames "${builtin_module_shortnames} ${mod_module_name}")
- CONFIGURE_FILE(${static_mod} ${PROJECT_BINARY_DIR}/ COPYONLY)
- SET(extra_builtin_modules ${extra_builtin_modules} ${PROJECT_BINARY_DIR}/${mod_basename})
- ENDFOREACH()
- EXECUTE_PROCESS(COMMAND cmd /c "echo ${builtin_module_shortnames}| awk -f ${CMAKE_CURRENT_SOURCE_DIR}/build/build-modules-c.awk > ${PROJECT_BINARY_DIR}/modules.c" RESULT_VARIABLE rv)
- IF(rv)
- MESSAGE(FATAL_ERROR "build-modules-c.awk failed (${rv})")
- ENDIF()
-ELSE()
- # no extra built-in modules; use the default modules.c to avoid the awk prereq
- CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/os/win32/modules.c ${PROJECT_BINARY_DIR}/ COPYONLY)
-ENDIF()
+STRING(REPLACE "," ";" WITH_MODULE_LIST "${WITH_MODULES}")
+FOREACH(static_mod ${WITH_MODULE_LIST})
+ STRING(REGEX MATCH "[^/]+\\.c" mod_basename ${static_mod})
+ STRING(REGEX REPLACE "^mod_(.*)\\.c" "\\1" mod_module_name ${mod_basename})
+ LIST(APPEND builtin_module_shortnames "${mod_module_name}")
+ CONFIGURE_FILE(${static_mod} ${PROJECT_BINARY_DIR}/ COPYONLY)
+ SET(extra_builtin_modules ${extra_builtin_modules} ${PROJECT_BINARY_DIR}/${mod_basename})
+ENDFOREACH()
+
+generate_builtin_modules_c("${PROJECT_BINARY_DIR}/modules.c" "${builtin_module_shortnames}")
# for easy reference from .dll/.so builds
CONFIGURE_FILE(os/win32/BaseAddr.ref ${PROJECT_BINARY_DIR}/ COPYONLY)