加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
CMakeLists.txt 1.10 KB
一键复制 编辑 原始数据 按行查看 历史
gaoqingfeng 提交于 2023-02-03 19:53 . add kcp tester
cmake_minimum_required(VERSION 2.4)
#project name
set(PROJECTNAME test-anet)
#output path
set(OUTPUT ./bin/)
project(${PROJECTNAME})
set(CMAKE_C_COMPILER gcc)
set(CMAKE_CXX_COMPILER g++)
#include directories
include_directories(
./
../pipe
../anet
../anet/asio
../anet/prometh
../anet/timer
../anet/log
../anet/pool
../kcp
)
#library.
SET(LIBRARIES
-lpthread
)
#link directories
link_directories(
)
#definition flag
add_definitions(
-std=c++17
-g
-O3
#-Wno-unused-variable
-Wall
#-Wno-deprecated
)
#output path
set(EXECUTABLE_OUTPUT_PATH ${OUTPUT})
#project src files
file(GLOB SRC_FILES "*.cpp" "*.hpp" "*.h" "*.c" "*.cc")
aux_source_directory(../anet ANET_FILES)
aux_source_directory(../anet/timer TIMER_SRC)
aux_source_directory(../anet/log LOG_SRC)
aux_source_directory(../pipe PIPE_SRC)
aux_source_directory(../kcp KCP_SRC)
#merge src files to SRC.
set(SRC
${SRC_FILES}
${TIMER_SRC}
${LOG_SRC}
${ANET_FILES}
${PIPE_SRC}
${KCP_SRC}
)
#executable
add_executable(
${PROJECTNAME}
${SRC}
)
#link libraries
target_link_libraries(${PROJECTNAME} ${LIBRARIES})
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化