Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ message(STATUS "Configuring PHP")
message(STATUS "---------------\n")

add_subdirectory(pear)
add_subdirectory(TSRM)
add_subdirectory(win32)
add_subdirectory(main)
add_subdirectory(scripts)
Expand Down
35 changes: 0 additions & 35 deletions cmake/TSRM/CMakeLists.txt

This file was deleted.

38 changes: 35 additions & 3 deletions cmake/Zend/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#[=============================================================================[
Zend Engine.

TSRM (Thread-Safe Resource Manager) is a separate directory in php-src as it was
once a standalone project. Here it is part of the Zend Engine as it is not meant
to be a separate library anymore. In the future, TSRM should ideally be
integrated into Zend Engine.

CMake target properties for the `Zend::Zend` (`zend`) target:

* `VERSION`
Expand Down Expand Up @@ -302,9 +307,6 @@ target_link_libraries(
zend
PRIVATE
PHP::configuration
PUBLIC
PHP::TSRM
$<TARGET_OBJECTS:PHP::TSRM>
)

target_include_directories(
Expand All @@ -318,6 +320,7 @@ target_compile_definitions(
zend
PRIVATE
ZEND_ENABLE_STATIC_TSRMLS_CACHE=1
PUBLIC
$<$<PLATFORM_ID:Windows>:LIBZEND_EXPORTS>
)

Expand Down Expand Up @@ -666,3 +669,32 @@ install(
FILE_SET HEADERS
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PHP_INCLUDE_PREFIX}/Zend
)

################################################################################
# Configure TSRM.
################################################################################

set(tsrmSourceDir ${CMAKE_CURRENT_SOURCE_DIR}/../TSRM)

target_sources(
zend
PRIVATE
$<$<PLATFORM_ID:Windows>:${tsrmSourceDir}/tsrm_win32.c>
${tsrmSourceDir}/TSRM.c
PUBLIC
FILE_SET tsrm
TYPE HEADERS
BASE_DIRS ${tsrmSourceDir}
FILES
$<$<PLATFORM_ID:Windows>:${tsrmSourceDir}/tsrm_win32.h>
${tsrmSourceDir}/TSRM.h
)

target_include_directories(zend PUBLIC ${tsrmSourceDir})
target_compile_definitions(zend PUBLIC $<$<PLATFORM_ID:Windows>:TSRM_EXPORTS>)

install(
TARGETS zend
FILE_SET tsrm
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PHP_INCLUDE_PREFIX}/TSRM
)
Loading