Skip to content

Commit d69c574

Browse files
committed
Add various improvements
- Check section headers simplified - ext/zip ZIP_STATIC definition adjusted for proper target system and libzip versions, still needs to be fine-tuned further - Check segments alignment module result message fixed
1 parent 81c2fe9 commit d69c574

File tree

14 files changed

+97
-90
lines changed

14 files changed

+97
-90
lines changed

cmake/CMakeLists.txt

Lines changed: 18 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ cmake_minimum_required(VERSION 3.25 FATAL_ERROR)
44
include(cmake/CMakeDefaults.cmake)
55

66
message("
7-
+--------------------------------------------------------------------+
8-
| Running system checks |
9-
+--------------------------------------------------------------------+
7+
Running system checks
8+
---------------------
109
")
1110

1211
message(STATUS "CMake version: ${CMAKE_VERSION}")
@@ -28,42 +27,9 @@ set(CMAKE_C_STANDARD_REQUIRED TRUE)
2827
# Configure project.
2928
include(cmake/Bootstrap.cmake)
3029

31-
# Create a project wide INTERFACE library with project configuration.
32-
add_library(php_configuration INTERFACE)
33-
add_library(PHP::configuration ALIAS php_configuration)
34-
target_include_directories(
35-
php_configuration
36-
INTERFACE
37-
${PHP_BINARY_DIR}
38-
${PHP_SOURCE_DIR}
39-
)
40-
41-
# Create a custom target for generating files (parsers, lexers, etc.) manually:
42-
# cmake --build <dir> -t php_generate_files
43-
add_custom_target(php_generate_files)
44-
45-
# Configure build types.
46-
include(cmake/BuildTypes.cmake)
47-
48-
# Set platform-specific configuration.
49-
include(cmake/Platform.cmake)
50-
51-
# Set PHP configuration options and variables.
52-
include(cmake/Configuration.cmake)
53-
54-
# Check requirements.
55-
include(cmake/Requirements.cmake)
56-
57-
# Run PHP configuration checks.
58-
include(cmake/ConfigureChecks.cmake)
59-
60-
# Check compilation options.
61-
include(cmake/Flags.cmake)
62-
6330
message("
64-
+--------------------------------------------------------------------+
65-
| Configuring SAPI modules |
66-
+--------------------------------------------------------------------+
31+
Configuring SAPI modules
32+
------------------------
6733
")
6834
add_subdirectory(sapi/apache2handler)
6935
add_subdirectory(sapi/cgi)
@@ -75,24 +41,21 @@ add_subdirectory(sapi/litespeed)
7541
add_subdirectory(sapi/phpdbg)
7642

7743
message("
78-
+--------------------------------------------------------------------+
79-
| Configuring PHP extensions |
80-
+--------------------------------------------------------------------+
44+
Configuring PHP extensions
45+
--------------------------
8146
")
8247
include(PHP/Extensions)
8348
php_extensions_add(ext)
8449

8550
message("
86-
+--------------------------------------------------------------------+
87-
| Configuring Zend engine |
88-
+--------------------------------------------------------------------+
51+
Configuring Zend engine
52+
-----------------------
8953
")
9054
add_subdirectory(Zend)
9155

9256
message("
93-
+--------------------------------------------------------------------+
94-
| Configuring PHP |
95-
+--------------------------------------------------------------------+
57+
Configuring PHP
58+
---------------
9659
")
9760
add_subdirectory(pear)
9861
add_subdirectory(TSRM)
@@ -170,14 +133,14 @@ endif()
170133
include(PHP/FeatureSummary)
171134

172135
message("
173-
+--------------------------------------------------------------------+
174-
| License: |
175-
| This software is subject to the PHP License, available in this |
176-
| distribution in the file LICENSE. By continuing this installation |
177-
| process, you are bound by the terms of this license agreement. |
178-
| If you do not agree with the terms of this license, you must abort |
179-
| the installation process at this point. |
180-
+--------------------------------------------------------------------+
136+
License
137+
-------
138+
139+
This software is subject to the PHP License, available in this
140+
distribution in the file LICENSE. By continuing this installation
141+
process, you are bound by the terms of this license agreement.
142+
If you do not agree with the terms of this license, you must abort
143+
the installation process at this point.
181144
182145
Thank you for using PHP.
183146
")

cmake/cmake/Bootstrap.cmake

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,35 @@ include(PHP/InterproceduralOptimization)
1919

2020
# Set CMAKE_POSITION_INDEPENDENT_CODE.
2121
include(PHP/PositionIndependentCode)
22+
23+
# Create a project wide INTERFACE library with project configuration.
24+
add_library(php_configuration INTERFACE)
25+
add_library(PHP::configuration ALIAS php_configuration)
26+
target_include_directories(
27+
php_configuration
28+
INTERFACE
29+
${PHP_BINARY_DIR}
30+
${PHP_SOURCE_DIR}
31+
)
32+
33+
# Create a custom target for generating files (parsers, lexers, etc.) manually:
34+
# cmake --build <dir> -t php_generate_files
35+
add_custom_target(php_generate_files)
36+
37+
# Configure build types.
38+
include(cmake/BuildTypes.cmake)
39+
40+
# Set platform-specific configuration.
41+
include(cmake/Platform.cmake)
42+
43+
# Set PHP configuration options and variables.
44+
include(cmake/Configuration.cmake)
45+
46+
# Check requirements.
47+
include(cmake/Requirements.cmake)
48+
49+
# Run PHP configuration checks.
50+
include(cmake/ConfigureChecks.cmake)
51+
52+
# Check compilation options.
53+
include(cmake/Flags.cmake)

cmake/cmake/ConfigureChecks.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ include(FeatureSummary)
1616
include(PHP/CheckAttribute)
1717
include(PHP/SearchLibraries)
1818

19+
message("
20+
Running global configure checks
21+
-------------------------------
22+
")
23+
1924
################################################################################
2025
# Check headers.
2126
################################################################################

cmake/cmake/modules/PHP/CheckSegmentsAlignment.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,10 @@ else()
136136
endif()
137137

138138
if(
139-
HAVE_ALIGNMENT_FLAGS_C
140-
OR HAVE_ALIGNMENT_FLAGS_CXX
141-
OR HAVE_ZMAX_PAGE_SIZE_C
142-
OR HAVE_ZMAX_PAGE_SIZE_CXX
139+
PHP_HAVE_ALIGNMENT_FLAGS_C
140+
OR PHP_HAVE_ALIGNMENT_FLAGS_CXX
141+
OR PHP_HAVE_ZMAX_PAGE_SIZE_C
142+
OR PHP_HAVE_ZMAX_PAGE_SIZE_CXX
143143
)
144144
message(CHECK_PASS "done")
145145
else()

cmake/cmake/modules/PHP/FeatureSummary.cmake

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ include_guard(GLOBAL)
1414
include(FeatureSummary)
1515

1616
message("
17-
+--------------------------------------------------------------------+
18-
| Summary |
19-
+--------------------------------------------------------------------+
17+
Summary
18+
-------
2019
")
2120

2221
# Output enabled features.

cmake/ext/zip/CMakeLists.txt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,18 @@ endif()
6262

6363
target_link_libraries(php_zip PRIVATE libzip::libzip)
6464

65-
# TODO: Adjust this if the libzip is a static library.
66-
if(TODO)
67-
set(ZIP_STATIC 1 CACHE INTERNAL "Whether the libzip is a static library.")
68-
#set(LZMA_API_STATIC 1)
65+
# Note: ZIP_STATIC needs to be defined when using static libzip on Windows only
66+
# since version 1.0 to 1.3.2
67+
if(
68+
CMAKE_SYSTEM_NAME STREQUAL "Windows"
69+
AND libzip_VERSION VERSION_GREATER_EQUAL 1.0
70+
AND libzip_VERSION VERSION_LESS 1.4.0
71+
)
72+
# TODO: Adjust this if the libzip is a static library.
73+
if(TODO)
74+
set(ZIP_STATIC 1 CACHE INTERNAL "Whether the libzip is a static library.")
75+
#set(LZMA_API_STATIC 1)
76+
endif()
6977
endif()
7078

7179
# TODO: When downloading and building libzip from source additional deps are

cmake/sapi/apache2handler/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ add_feature_info(
1818
"Apache 2 handler SAPI module"
1919
)
2020

21-
message(CHECK_START "Checking whether to build apache2handler SAPI")
21+
message(CHECK_START "Checking apache2handler SAPI")
2222
if(SAPI_APACHE2HANDLER)
23-
message(CHECK_PASS "yes")
23+
message(CHECK_PASS "enabled")
2424
else()
25-
message(CHECK_FAIL "no")
25+
message(CHECK_FAIL "disabled")
2626
return()
2727
endif()
2828

cmake/sapi/cgi/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ add_feature_info(
99
"CGI SAPI executable"
1010
)
1111

12-
message(CHECK_START "Checking whether to build CGI SAPI")
12+
message(CHECK_START "Checking cgi SAPI")
1313
if(SAPI_CGI)
14-
message(CHECK_PASS "yes")
14+
message(CHECK_PASS "enabled")
1515
else()
16-
message(CHECK_FAIL "no")
16+
message(CHECK_FAIL "disabled")
1717
return()
1818
endif()
1919

cmake/sapi/cli/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ add_feature_info(
1111
"Command-line interface SAPI executable"
1212
)
1313

14-
message(CHECK_START "Checking whether to build cli SAPI")
14+
message(CHECK_START "Checking cli SAPI")
1515
if(SAPI_CLI)
16-
message(CHECK_PASS "yes")
16+
message(CHECK_PASS "enabled")
1717
else()
18-
message(CHECK_FAIL "no")
18+
message(CHECK_FAIL "disabled")
1919
return()
2020
endif()
2121

cmake/sapi/embed/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ add_feature_info(
88
"Embed SAPI module"
99
)
1010

11-
message(CHECK_START "Checking whether to build embed SAPI")
11+
message(CHECK_START "Checking embed SAPI")
1212
if(SAPI_EMBED)
13-
message(CHECK_PASS "yes")
13+
message(CHECK_PASS "enabled")
1414
else()
15-
message(CHECK_FAIL "no")
15+
message(CHECK_FAIL "disabled")
1616
return()
1717
endif()
1818

0 commit comments

Comments
 (0)