Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

c文件依赖的头文件搜索问题 #10

Open
Han40 opened this issue Feb 25, 2019 · 3 comments
Open

c文件依赖的头文件搜索问题 #10

Han40 opened this issue Feb 25, 2019 · 3 comments

Comments

@Han40
Copy link

Han40 commented Feb 25, 2019

你好,我发现你这边的设计可能存在缺陷,比如:当我的编译选项中添加了头文件引用的目录inc: dir
1,dir2。 当我改了里面的头文件的内容应该是不支持 增量编译的,无法触发 依赖这些头文件的。
因为我分析了你的代码,貌似只支持 搜索到与c文件同一目录下的头文件 依赖关系

@skywind3000
Copy link
Owner

skywind3000 commented Feb 25, 2019

不是的,你 C 代码里:

#include "../include/foo.h"

也能正常分析出来,所有双引号的相对路径都可以分析出来。

@Han40
Copy link
Author

Han40 commented Feb 25, 2019

可是一般编译选项中加了-I选项,后跟路径,源代码里一般不加绝对路径了,只需要include “foo.h”
由于我是汽车行业的,一般的c代码都是自动生成的,没有绝对路径引用

@skywind3000
Copy link
Owner

好吧,这么写就没法分析到了,等我有空改成 gcc -MM 来分析头文件依赖。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants