Skip to content

Commit 0aa3411

Browse files
committed
Fix globbing inconsistencies
Glob behaves differently on case-insensitive file systems such as on Windows and macOS. Otherwise here also the credits shell script is fetched.
1 parent fd09510 commit 0aa3411

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

bin/init.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Usage:
1414
cmake -P bin/init.cmake
1515
#]=============================================================================]
1616

17-
cmake_minimum_required(VERSION 3.25)
17+
cmake_minimum_required(VERSION 3.25...3.31)
1818

1919
if(NOT CMAKE_SCRIPT_MODE_FILE)
2020
message(FATAL_ERROR "This is a command-line script.")

bin/php.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Usage examples:
3333
./bin/php.cmake
3434
#]=============================================================================]
3535

36-
cmake_minimum_required(VERSION 3.25)
36+
cmake_minimum_required(VERSION 3.25...3.31)
3737

3838
if(NOT CMAKE_SCRIPT_MODE_FILE)
3939
message(FATAL_ERROR "This is a command-line script.")

cmake/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ include(cmake/CMakeDefaults.cmake)
55

66
message(STATUS "Initializing PHP build system")
77
message(STATUS "=============================")
8-
98
message(STATUS "CMake version: ${CMAKE_VERSION}")
109
message(STATUS "CMake generator: ${CMAKE_GENERATOR}")
1110

cmake/cmake/scripts/GenerateCredits.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ set(template [[
3131
]])
3232

3333
file(GLOB credits ${PHP_SOURCE_DIR}/*/*/CREDITS)
34+
# Case-sensitive filtering, GLOB on macOS/Windows is case-insensitive.
35+
list(FILTER credits INCLUDE REGEX ".*CREDITS$")
3436

35-
foreach(credit ${credits})
37+
foreach(credit IN LISTS credits)
3638
cmake_path(GET credit PARENT_PATH dir)
3739
cmake_path(GET dir PARENT_PATH dir)
3840
cmake_path(GET dir FILENAME dir)
@@ -46,7 +48,7 @@ endforeach()
4648

4749
list(REMOVE_DUPLICATES dirs)
4850

49-
foreach(dir ${dirs})
51+
foreach(dir IN LISTS dirs)
5052
list(SORT ${dir}_credits CASE INSENSITIVE)
5153
list(JOIN ${dir}_credits ";\n" content)
5254
set(content "${template}${content};\n")

cmake/ext/standard/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,8 @@ check_symbol_exists(
493493

494494
block()
495495
file(GLOB credits ${PHP_SOURCE_DIR}/*/*/CREDITS)
496+
# Case-sensitive filtering, GLOB on macOS/Windows is case-insensitive.
497+
list(FILTER credits INCLUDE REGEX ".*CREDITS$")
496498

497499
# The CODEGEN keyword adds the custom command to a global 'codegen' target.
498500
set(codegen "")

0 commit comments

Comments
 (0)