当前位置:网站首页>Cmake命令之target_compile_options
Cmake命令之target_compile_options
2022-06-24 07:52:00 【物随心转】
一、介绍
这个命令是为某个需要编译的目标增加编译选项
命令格式:
target_compile_options(<target> [BEFORE]
<INTERFACE|PUBLIC|PRIVATE> [items1...]
[<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])
target_compile_options会增加选项(options)到COMPILE_OPTIONS或者INTERFACE_COMPILE_OPOTIONS目标属性(也就是增加编译选项的意思)。这些选项会在编译给定目标(<target>)时使用,给定目标必须已经通过add_executable()或者add_library()这种命令添加到项目中,并且不能是别名目标。
二、使用
cmake_minimum_required(VERSION 3.10)
project(cmake_gcc_options_try_c C)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
add_executable(cmake_gcc_options_try_c main.c)
target_compile_options(cmake_gcc_options_try_c
PUBLIC -W -Wall -Wextra -pedantic -pedantic-errors)
参考:
边栏推荐
- [redis realize Secondary killing Business ①] Overview of Secondary killing Process | Basic Business Realization
- MySQL data (Linux Environment) scheduled backup
- PM2 deploy nuxt3 JS project
- 从华为WeAutomate数字机器人论坛,看政企领域的“政务新智理”
- Common emoticons
- Opencv maximum filtering (not limited to images)
- [noi simulation] pendulum (linear algebra, Du Jiao sieve)
- Data middle office: middle office practice and summary
- 【LeetCode】415. String addition
- I heard that you are still spending money to buy ppt templates from the Internet?
猜你喜欢
The native applet uses canvas to make posters, which are scaled to the same scale. It is similar to the uniapp, but the writing method is a little different
A tip to read on Medium for free
学习太极创客 — ESP8226 (十三)OTA
KaFormer个人笔记整理
Depens:*** but it is not going to be installed
小白学习MySQL - 增量统计SQL的需求
深入了解 border
关于 GIN 的路由树
[Niuke] length of the last word of HJ1 string
【ES6闯关】Promise堪比原生的自定义封装(万字)
随机推荐
Data midrange: detailed explanation of the technical stack of data acquisition and extraction
华为路由器:ipsec技术
“论解不了数独所以选择做个数独游戏这件事”
2022-06-23:给定一个非负数组,任意选择数字,使累加和最大且为7的倍数,返回最大累加和。 n比较大,10的5次方。 来自美团。3.26笔试。
Kaformer personal notes
MYCAT read / write separation and MySQL master-slave synchronization
【gdb调试工具】| 如何在多线程、多进程以及正在运行的程序下调试
MBA-day25 最值问题-应用题
4274. 后缀表达式
[noi Simulation Competition] geiguo and time chicken (structure)
4275. Dijkstra sequence
Scheme of alcohol concentration tester based on single chip microcomputer
1704. judge whether the two halves of a string are similar
金仓KFS replicator安装(Oracle-KES)
1528. rearrange strings
当程序员被问会不会修电脑时… | 每日趣闻
Opencv maximum filtering (not limited to images)
Matlab camera calibrator camera calibration
From the Huawei weautomate digital robot forum, we can see the "new wisdom of government affairs" in the field of government and enterprises
EasyExcel单sheet页与多sheet页写出