Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
CMakeLists.txt for PHP-extension. This CMake file is just for syntax highlighting in CLion.
cmake_minimum_required(VERSION 3.5)
project(extname C)
message("Begin cmaking of PHP extension ...")
# -std=gnu99
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ggdb -O0 -Wall -std=gnu99 -fvisibility=hidden")
set(PHP_VERSION 7.2.9)
get_filename_component(PHP_SRC_PATH "~/src/php/source/${PHP_VERSION}" ABSOLUTE)
include_directories(
"${PHP_SRC_PATH}"
"${PHP_SRC_PATH}/main"
"${PHP_SRC_PATH}/Zend"
"${PHP_SRC_PATH}/TSRM"
"${PHP_SRC_PATH}/ext"
"${PHP_SRC_PATH}/sapi"
)
FILE(GLOB KernelHeaders ./kernel/*.h)
FILE(GLOB KernelSources ./kernel/*.c)
set(SOURCE_FILES
php_extname.c
php_extname.h
${KernelHeaders}
${KernelSources}
)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/config.h")
add_definitions(-DHAVE_CONFIG_H)
set(SOURCE_FILES "${SOURCE_FILES};config.h")
endif()
add_library(extname ${SOURCE_FILES})
message("End cmaking of PHP extension ...")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.