-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
40 lines (31 loc) · 1022 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# https://dev.to/jasny/developing-a-php-extension-in-clion-3oo1
cmake_minimum_required(VERSION 3.26)
project(php_perfidious C)
set(CMAKE_C_STANDARD 99)
set(SOURCE_FILES
src/extension.c
src/exceptions.c
src/functions.c
src/handle.c
src/pmu_event_info.c
src/pmu_info.c
src/read_result.c
)
add_compile_definitions(HAVE_CONFIG_H=1)
execute_process (
COMMAND php-config --include-dir
OUTPUT_VARIABLE PHP_SOURCE
)
string(REGEX REPLACE "\n$" "" PHP_SOURCE "${PHP_SOURCE}")
message("Using source directory: ${PHP_SOURCE}")
include_directories(${PHP_SOURCE})
include_directories(${PHP_SOURCE}/main)
include_directories(${PHP_SOURCE}/Zend)
include_directories(${PHP_SOURCE}/TSRM)
include_directories(${PROJECT_SOURCE_DIR})
include_directories(${PROJECT_SOURCE_DIR}/.direnv/include)
add_custom_target(configure
COMMAND phpize && ./configure
DEPENDS ${SOURCE_FILES}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
add_library(___ EXCLUDE_FROM_ALL ${SOURCE_FILES})