在Eclipse中,您可以为工作区中的所有项目定义预处理器变量吗?

时间:2022-04-25 19:02:00

I have a Eclipse workspace with several C projects: Project1, Project2, Project3, ... Project2, Project3, etc. all include a header from Project1. This header is heavy on preprocessor directives, such as:

我有一个Eclipse工作区,其中有几个C项目:Project1、Project2、Project3、……Project2、Project3等都包含了来自Project1的header。这个头重于预处理指令,例如:

#ifdef OPTION1
  typedef MY_INT int;
#endif

To make Eclipse find MY_INT in the code in Project2, Project3, I currently have to add the preprocessor definition OPTION1 for each project separately.

要让Eclipse在Project2, Project3的代码中找到MY_INT,我目前必须为每个项目分别添加预处理程序定义选项1。

Is there a way to define OPTION1 globally, just once, for all the projects in the workspace.

是否有一种方法可以全局地定义OPTION1,只对工作区中的所有项目定义一次。

1 个解决方案

#1


0  

Short answer: no.

简短的回答:没有。

A bit longer: workspace may consist of many projects with completely different natures. Not all of them have preprocessor settings at all.

稍微长一点:工作区可能由许多性质完全不同的项目组成。不是所有的都有预处理器设置。

#1


0  

Short answer: no.

简短的回答:没有。

A bit longer: workspace may consist of many projects with completely different natures. Not all of them have preprocessor settings at all.

稍微长一点:工作区可能由许多性质完全不同的项目组成。不是所有的都有预处理器设置。