[英]Global compiler flags in CDT
We are using the -Werror -Wextra -Wall -pedantic compiler flags, and C++11 diaelect. 我们正在使用-Werror -Wextra -Wall -pedantic编译器标志,以及C ++ 11 diaelect。 We want to use these for all of our projects. 我们希望将这些用于我们的所有项目。 Currently we are setting these to each project by Project properties -> C/C++ Build -> Settings -> Tool Settings -> GCC C++ Compiler
. 当前,我们通过Project properties -> C/C++ Build -> Settings -> Tool Settings -> GCC C++ Compiler
将它们设置到每个项目。
But this is a project-level setting. 但这是项目级别的设置。
I read lots of questions, i tried lots of things, but i did not found a working solution for setting the flags globally. 我读了很多问题,尝试了很多事情,但是我没有找到一个可行的解决方案来全局设置标志。 Is there a way to do this? 有没有办法做到这一点? I am using the latest Eclipse (4.4 Luna), and the latest CDT (8.4). 我正在使用最新的Eclipse(4.4 Luna)和最新的CDT(8.4)。
I am also using eclipse luna. 我也在使用Eclipse Luna。
In top menu : Window
-> Preferences
-> C/C++
-> Build
-> Settings
在顶部菜单中: Window
-> Preferences
-> C/C++
-> Build
-> Settings
Select Discovery
tab, and change the CDT GCC Built-in settings
(if you use gcc). 选择Discovery
选项卡,然后更改CDT GCC Built-in settings
(如果使用gcc)。
Default is like : 默认值是这样的:
${COMMAND} -E -P -v -dD "${INPUTS}"
change to 改成
${COMMAND} -E -P -v -dD "${INPUTS}" -Werror -Wextra -Wall -pedantic
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.