繁体   English   中英

g ++ / c ++ makefile依赖项生成会忽略boost标头?

[英]g++/c++ makefile dependency generation to ignore boost headers?

我在g ++(和c ++)中使用makefile依赖项生成选项,如下所示:

c++ -I/opt/local/include -MM main.cc

在文件上,main.cc:

#include <iostream>
#include <boost/shared_ptr.hpp>

#include "projects/all_projects.h"

int main(int argc, const char * argv[])
{
  // ...
}

-MM选项可防止为iostream生成依赖项,这是很好的,但对于shared_ptr.hpp则不行。 有没有一种方法可以防止对Boost头文件(或什至对于尖括号中的任何头文件)生成依赖关系?

我读到gcc的较早版本曾经将尖括号中的所有标头都视为系统标头,但事实已不再如此。

使用c++ -isystem /opt/local/include -MM main.cc

(和man gcc :-))

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM