13 Star 67 Fork 21

johnsonyl/cpps

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
CMakeLists.txt 2.83 KB
一键复制 编辑 原始数据 按行查看 历史
johnsonyl 提交于 2024-01-08 14:43 . 更新MAC编译问题
# CMakeList.txt: 顶层 CMake 项目文件,在此处执行全局配置
# 并包含子项目。
#
cmake_minimum_required (VERSION 3.5)
project ("libcpps")
if (CMAKE_HOST_WIN32)
set(WINDOWS 1)
elseif (CMAKE_HOST_APPLE)
set(MACOS 1)
elseif (CMAKE_HOST_UNIX)
set(LINUX 1)
endif ()
#默认不启动TCMALLOC
if (NOT CPPS_ENABLE_TCMALLOC)
set(CPPS_ENABLE_TCMALLOC "OFF")
endif()
if (NOT EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
if (NOT CPPS_ENABLE_ZLIB)
set(CPPS_ENABLE_ZLIB "ON" CACHE STRING "" FORCE)
endif()
endif()
if (WINDOWS)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
set(CMAKE_CXX_STANDARD 11)
elseif (MACOS)
#default release.
if (NOT EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
endif()
endif()
set(CMAKE_CXX_STANDARD 11)
if(CMAKE_BUILD_TYPE STREQUAL "Release" )
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -Wfatal-errors -std=c++11 -Wno-format-y2k -fpermissive -m64 -Wimplicit-int-conversion -std=gnu++0x -fPIC -fpermissive -Wno-unused-function -O3 -Wall ")
add_definitions(-D__APPLE__ -D_GLIBCXX_USE_CXX11_ABI=1 -D_FILE_OFFSET_BITS=64 -DNDEBUG)
message("release build")
else()
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -Wfatal-errors -std=c++11 -Wno-format-y2k -Wimplicit-int-conversion -fpermissive -m64 -std=gnu++0x -Wdeprecated-declarations -Wunused-function -fPIC -fpermissive -Wno-unused-function -O0 -Wall -g -ggdb ")
add_definitions(-D__APPLE__ -D_GLIBCXX_USE_CXX11_ABI=1 -D_FILE_OFFSET_BITS=64 -DDEBUG)
message("debug build")
endif()
# TODO: 如有需要,请添加测试并安装目标。
set(CMAKE_INSTALL_PREFIX /usr/local/opt/cpps)
elseif (LINUX)
#default release.
if (NOT EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
endif()
endif()
set(CMAKE_CXX_STANDARD 11)
if(CMAKE_BUILD_TYPE STREQUAL "Release" )
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -Wfatal-errors -std=c++11 -Wno-format-y2k -fpermissive -m64 -std=gnu++0x -fPIC -fpermissive -Wno-unused-function -O3 -Wall")
add_definitions(-DLINUX -D_GLIBCXX_USE_CXX11_ABI=1 -D_FILE_OFFSET_BITS=64 -DNDEBUG)
message("release build")
else()
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -Wfatal-errors -std=c++11 -Wno-format-y2k -fpermissive -m64 -std=gnu++0x -fPIC -fpermissive -Wno-unused-function -O0 -Wall -g -ggdb")
add_definitions(-DLINUX -D_GLIBCXX_USE_CXX11_ABI=1 -D_FILE_OFFSET_BITS=64 -DDEBUG)
message("debug build")
endif()
# TODO: 如有需要,请添加测试并安装目标。
set(CMAKE_INSTALL_PREFIX /usr/local)
ENDIF()
# 包含子项目。
add_subdirectory ("src")
add_subdirectory ("cpps")
add_subdirectory ("example/demo")
add_subdirectory ("csharp/cpps_interface")
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/cppscript/cpps.git
[email protected]:cppscript/cpps.git
cppscript
cpps
cpps
master

搜索帮助