Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
CMakeLists.txt for PHP-extension
cmake_minimum_required(VERSION 3.6)
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(ENV{PROJECT_ROOT} "${CMAKE_HOME_DIRECTORY}")
# NOTE: This CMake file is just for syntax highlighting in CLion
include_directories(
~/src/php/7.3.0RC1
~/src/php/7.3.0RC1/main
~/src/php/7.3.0RC1/Zend
~/src/php/7.3.0RC1/TSRM
~/src/php/7.3.0RC1/ext
~/src/php/7.3.0RC1/sapi
)
FILE(GLOB KernelHeaders ./kernel/*.h)
FILE(GLOB KernelSources ./kernel/*.c)
set(SOURCE_FILES
php_extname.c
php_extname.h
${KernelHeaders}
${KernelSources}
)
if(EXISTS "$ENV{PROJECT_ROOT}/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.