1 Star 0 Fork 347

ljwaheng/swoole-src

forked from swoole/swoole-src 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
CMakeLists.txt 1.74 KB
一键复制 编辑 原始数据 按行查看 历史
韩天峰 提交于 2018-06-12 18:06 . update cmake file
PROJECT(libswoole)
ENABLE_LANGUAGE(ASM)
SET(SWOOLE_VERSION 4.0.0)
SET(SWOOLE_CLFLAGS pthread rt dl ssl crypt crypto nghttp2)
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
SET(CMAKE_BUILD_TYPE Debug)
file(GLOB_RECURSE SRC_LIST FOLLOW_SYMLINKS src/*.c src/*.cc thirdparty/boost/asm/jump_x86_64_sysv_elf_gas.S thirdparty/boost/asm/make_x86_64_sysv_elf_gas.S)
file(GLOB_RECURSE HEAD_FILES FOLLOW_SYMLINKS include/*.h)
SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
#message(STATUS "source=${SRC_LIST}")
#message(STATUS "header=${HEAD_FILES}")
add_definitions(-DHAVE_CONFIG_H)
INCLUDE_DIRECTORIES(BEFORE ./include ./ /usr/local/php/include /usr/local/php/include/Zend /usr/local/php/include/main)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
#libary
add_library(shared SHARED ${SRC_LIST})
add_library(static STATIC ${SRC_LIST})
set_target_properties(shared PROPERTIES OUTPUT_NAME "swoole" VERSION ${SWOOLE_VERSION})
set_target_properties(static PROPERTIES OUTPUT_NAME "swoole" VERSION ${SWOOLE_VERSION})
target_link_libraries(shared ${SWOOLE_CLFLAGS})
target_link_libraries(static ${SWOOLE_CLFLAGS})
LINK_DIRECTORIES(${LIBRARY_OUTPUT_PATH})
#test_server
set(TEST_SRC_LIST examples/test_server.c)
add_executable(test_server ${TEST_SRC_LIST})
add_dependencies(test_server static)
target_link_libraries(test_server ${SWOOLE_CLFLAGS} swoole)
#install
INSTALL(CODE "MESSAGE(\"Are you run command using root user?\")")
INSTALL(TARGETS shared static LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
INSTALL(FILES ${HEAD_FILES} DESTINATION include/swoole)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/swoole_config.h DESTINATION include/swoole)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/config.h DESTINATION include/swoole)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/ljwaheng/swoole.git
git@gitee.com:ljwaheng/swoole.git
ljwaheng
swoole
swoole-src
master

搜索帮助