Skip to content

Commit 4e0b8d3

Browse files
committed
Fix ASM language
In CMake, ASM can't be checked with check_language(ASM) as it needs some C or CXX enabled before. Also, all compilers should support assembly so ASM can be listed in the required languages in the project() directly.
1 parent f4aa18b commit 4e0b8d3

File tree

4 files changed

+7
-18
lines changed

4 files changed

+7
-18
lines changed

cmake/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ project(
1818
VERSION ${PHP_VERSION}
1919
DESCRIPTION "Widely-used general-purpose scripting language"
2020
HOMEPAGE_URL "https://www.php.net"
21-
LANGUAGES C
21+
LANGUAGES C ASM
2222
)
2323

2424
set(CMAKE_C_STANDARD 99)

cmake/Zend/CMakeLists.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,9 @@ project(
4444
Zend
4545
VERSION ${Zend_VERSION}
4646
DESCRIPTION "Zend Engine library"
47-
LANGUAGES C
47+
LANGUAGES C ASM
4848
)
4949

50-
include(CheckLanguage)
51-
check_language(ASM)
52-
if(CMAKE_ASM_COMPILER)
53-
enable_language(ASM)
54-
endif()
55-
5650
string(APPEND Zend_VERSION "${Zend_VERSION_LABEL}")
5751
message(STATUS "Zend Engine version: ${Zend_VERSION}")
5852

cmake/cmake/Bootstrap.cmake

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@ Configure project after the project() call.
44

55
include_guard(GLOBAL)
66

7-
# Optionally enable CXX for extensions and ASM for Zend Engine. ASM is enabled
8-
# last so CMake checks whether enabled compilers can also work for assembly.
7+
# Optionally enable CXX for extensions.
98
include(CheckLanguage)
10-
foreach(language CXX ASM)
11-
check_language(${language})
12-
if(CMAKE_${language}_COMPILER)
13-
enable_language(${language})
14-
endif()
15-
endforeach()
9+
check_language(CXX)
10+
if(CMAKE_CXX_COMPILER)
11+
enable_language(CXX)
12+
endif()
1613

1714
# Output linker information.
1815
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.29)

cmake/cmake/modules/Zend/Fibers.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,6 @@ if(ZEND_FIBER_ASM AND zend_fibers_asm_file)
171171
INTERFACE
172172
$<IF:$<BOOL:${SHADOW_STACK_SYSCALL}>,SHADOW_STACK_SYSCALL=1,SHADOW_STACK_SYSCALL=0>
173173
)
174-
175-
enable_language(ASM)
176174
else()
177175
cmake_push_check_state(RESET)
178176
# To use ucontext.h on macOS, the _XOPEN_SOURCE needs to be defined to any

0 commit comments

Comments
 (0)