代码拉取完成,页面将自动刷新
cmake_minimum_required(VERSION 3.1)
project(sylar)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(cmake/utils.cmake)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -rdynamic -O3 -fPIC -ggdb -std=c++11 -Wall -Wno-deprecated -Werror -Wno-unused-function -Wno-builtin-macro-redefined -Wno-deprecated-declarations -Wno-error=unused-result -Werror=return-type")
set(CMAKE_C_FLAGS "$ENV{CXXFLAGS} -rdynamic -O3 -fPIC -ggdb -std=c11 -Wall -Wno-deprecated -Werror -Wno-unused-function -Wno-builtin-macro-redefined -Wno-deprecated-declarations -Wno-error=unused-result -Werror=return-type")
include_directories(/usr/local/include)
set(SRC_DIR ${PROJECT_SOURCE_DIR}/sylar)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
find_package(Boost REQUIRED)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
endif()
find_package(Protobuf)
if(Protobuf_FOUND)
include_directories(${Protobuf_INCLUDE_DIRS})
endif()
find_package(OpenSSL REQUIRED)
if(OPENSSL_FOUND)
include_directories(${OPENSSL_INCLUDE_DIR})
endif()
find_package(ZLIB REQUIRED)
if(ZLIB_FOUND)
include_directories(${ZLIB_INCLUDE_DIR})
endif()
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/thirdpart/yaml-cpp)
#include_directories(${CMAKE_CURRENT_SOURCE_DIR}/thirdpart)
#include_directories(${CMAKE_CURRENT_SOURCE_DIR}/thirdpart/yaml-cpp/include)
ragelmaker(sylar/include/http/http11_parser.rl SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/sylar/src/)
ragelmaker(sylar/include/http/httpclient_parser.rl SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/sylar/src/)
ragelmaker(sylar/include/uri.rl SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/sylar/src/)
AUX_SOURCE_DIRECTORY(${SRC_DIR}/src SOURCE )
add_library(sylar SHARED ${SOURCE})
force_redefine_file_macro_for_sources(sylar) # 定义__FILE__为相对路径
target_include_directories(sylar PUBLIC ${SRC_DIR}/include )
set(LIBS
sylar
Threads::Threads
yaml-cpp
dl
jsoncpp
/usr/local/lib/libjsoncpp.a
${ZLIB_LIBRARIES}
${OPENSSL_LIBRARIES}
${PROTOBUF_LIBRARIES}
# event
hiredis_vip
# mysqlclient_r
zookeeper_mt
sqlite3
tinyxml2
jemalloc
)
sylar_add_executable(testlog "./tests/logTest.cc" sylar "${LIBS}")
sylar_add_executable(testconfig "./tests/configTest.cc" sylar "${LIBS}")
sylar_add_executable(logconfigTest "tests/logconfigTest.cc" sylar "${LIBS}")
sylar_add_executable(threadTest "./tests/threadTest.cc" sylar "${LIBS}")
sylar_add_executable(utilTest "./tests/utilTest.cc" sylar "${LIBS}")
sylar_add_executable(fiberTest "./tests/fiberTest.cc" sylar "${LIBS}")
sylar_add_executable(schedulerTest "./tests/schedulerTest.cc" sylar "${LIBS}")
sylar_add_executable(iomanagerTest "./tests/iomanagerTest.cc" sylar "${LIBS}")
sylar_add_executable(timerTest "./tests/timerTest.cc" sylar "${LIBS}")
sylar_add_executable(hookTest "./tests/hookTest.cc" sylar "${LIBS}")
sylar_add_executable(addressTest "./tests/addressTest.cc" sylar "${LIBS}")
sylar_add_executable(socketTest "./tests/socketTest.cc" sylar "${LIBS}")
sylar_add_executable(bytearrayTest "./tests/bytearrayTest.cc" sylar "${LIBS}")
sylar_add_executable(httpTest "./tests/httpTest.cc" sylar "${LIBS}")
sylar_add_executable(httpParseTest "./tests/httpParserTest.cc" sylar "${LIBS}")
sylar_add_executable(tcpServerTest "./tests/tcp_tcp_test.cc" sylar "${LIBS}")
sylar_add_executable(echo_server_example "./examples/echo_server.cc" sylar "${LIBS}")
sylar_add_executable(http_server_test "./tests/http_server_test.cc" sylar "${LIBS}")
sylar_add_executable(http_connection_test "./tests/http_connection_test.cc" sylar "${LIBS}")
sylar_add_executable(uri_test "./tests/uri_test.cc" sylar "${LIBS}")
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。