代码拉取完成,页面将自动刷新
cmake_minimum_required(VERSION 2.4)
# project name
SET(PROJECTNAME anet)
# set out put path
SET(LIBRARY_OUTPUT_PATH ./lib)
# project name.
project(${PROJECTNAME})
# c or cpp compiler.
SET(CMAKE_C_COMPILER gcc)
SET(CMAKE_CXX_COMPILER g++)
# find lib at /usr/lib
FIND_LIBRARY(PTHREAD_LIB pthread /usr/lib)
# include directories.
INCLUDE_DIRECTORIES(
./
./asio
./util
./log
./timer
./pool
./msgpack-c
./rpc
)
#definition flag
add_definitions(
-std=c++17
-g
-O3
-Wall
# -Wno-unused-variable
# -Wno-deprecated
)
# source directory setting.
file(GLOB SRC_FILES "*.cpp" "*.hpp" "*.h" "*.c" "*.cc")
aux_source_directory(./timer TIMER_SRC)
aux_source_directory(./log LOG_SRC)
aux_source_directory(./pool POOL_SRC)
aux_source_directory(./util UTIL_SRC)
#set src files
#merge all sourses files to SRC.
set(SRC
${SRC_FILES}
${TIMER_SRC}
${LOG_SRC}
${POOL_SRC}
${UTIL_SRC}
)
# .so or .a file output.
#ADD_LIBRARY(${PROJECTNAME} SHARED ${SRC})
ADD_LIBRARY(${PROJECTNAME} STATIC ${SRC})
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。