当前位置:网站首页>Cmake common commands (V)
Cmake common commands (V)
2022-07-19 11:13:00 【zhanglehes】
This paper mainly introduces CMAKE_BUILD_TYPE And related parameters
CMAKE_BUILD_TYPE
Optional values include
- Debug: Used without optimization , Build libraries or executables with debug symbols
- Release: Optimized libraries or executables for building , Does not contain debug symbols
- RelWithDebInfo: Because fewer optimization libraries or executables are built , Contains debug symbols
- MinSizeRel: Used for optimization without increasing the size of the object code , To build or executable files
Usage method
set(CMAKE_BUILD_TYPE "Debug") # CMakeLists.txt It is specified in
perhaps
cmake .. -D CMAKE_BUILD_TYPE="Debug" # Specify when generating commands
Example
set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g2 -ggdb") # Enable GDB
set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall") # Enable optimization (1~3)
Different type Corresponding compilation options
Type | Compilation options |
Debug | CMAKE_CXX_FLAGS_DEBUG |
Release | CMAKE_CXX_FLAGS_RELEASE |
RelWithDebInfo | CMAKE_CXX_FLAGS_RELWITHDEBINFO |
MinSizeRel | CMAKE_CXX_FLAGS_MINSIZEREL |
notes
- CMAKE_CXX_FLAGS Is a common parameter , The total compilation parameters are CMAKE_CXX_FLAGS + One of them CMAKE_CXX_FLAGS_XXX
2、 except CMAKE_CXX_FLAGS Variable , You can also use add_compile_options To add compilation options
# Determine compiler type , If it is gcc compiler , Add... To the compilation options c++11 Support
if(CMAKE_COMPILER_IS_GNUCXX)
add_compile_options(-std=c++11)
message(STATUS "optional:-std=c++11")
endif(CMAKE_COMPILER_IS_GNUCXX)
边栏推荐
- pjudge#21652-[PR #4]到底有没有九【数位dp】
- A fastandrobust volutionalneuralnetwork based defect detection model inproductqualitycontrol reading notes
- PowerCLI 脚本性能优化
- About hping streaming test tool
- Data Guard Broker的概念和Data Guard Broker的配置过程
- Huawei machine test: number of continuous licensing
- Qt 两个重载QListWidget控件对象实现selectitem drag拖拽
- 数据库锁的介绍与InnoDB共享,排他锁
- Google Earth engine - Hansen global forest change v1.8 (2000-2020) forest coverage and forest loss data set
- Tencent cloud server uses image to deploy WordPress personal website!
猜你喜欢

antd 下拉多选传值到后台做查询操作

ENVI_IDL:使用反距离权重法选取最近n个点插值(底层实现)并输出为Geotiff格式(效果等价于Arcgis中反距离权重插值)

LeetCode 2325. Decrypt message (map)

A fastandrobust convolutionalneuralnetwork-based defect detection model inproductqualitycontrol-阅读笔记

A fastandrobust convolutionalneuralnetwork-based defect detection model inproductqualitycontrol-閱讀筆記

Configuration of vscode+unity3d

UE4 understanding of animation blueprint

Win10的环境变量配置

每日刷题记录 (二十六)

NPC, Microsoft, etc. proposed inclusivefl: inclusive federal learning on heterogeneous devices
随机推荐
腾讯云服务器利用镜像部署WordPress个人网站!
Tier defect detection using full revolutionary network
Opencv programming: opencv3 X trains its own classifier
Modify the default path of jupyter see this article!
SAP S4 material management inventory module mard database table reading technical details
(2) Using MySQL
Antd drop-down multiple options to transfer values to the background for query operations
Avi Deployment Guide (2): overview of AVI architecture
Introduction to virtualization troubleshooting
A fastandrobust volutionalneuralnetwork based defect detection model inproductqualitycontrol reading notes
QT two overloaded qlistwidget control objects implement selectitem drag drag
NVIDIA uses AI to design GPU: the latest H100 has been used, which reduces the chip area by 25% compared with traditional EDA
Mysql 自增id、uuid与雪花id
Use and principle of ThreadLocal variable
剑指 Offer II 041. 滑动窗口的平均值
vulnhub inclusiveness: 1
LeetCode 745. 前缀和后缀搜索
nodeJS中promise对象对结果简便输出办法(建议使用异步终极方案 async+await)
High number__ Relationship between equation and function
Google Earth Engine——Hansen Global Forest Change v1.8 (2000-2020) 森林覆盖度和森林损失量数据集