简体   繁体   English

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

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

I am using the makefile dependency generation options in g++ (and c++) like this: 我在g ++(和c ++)中使用makefile依赖项生成选项,如下所示:

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

On a file, main.cc: 在文件上,main.cc:

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

#include "projects/all_projects.h"

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

The -MM option prevents the generation of dependencies for iostream which is good, but not for shared_ptr.hpp. -MM选项可防止为iostream生成依赖项,这是很好的,但对于shared_ptr.hpp则不行。 Is there a way I can prevent the dependency generation for boost headers (or even for any headers in angle brackets for that matter)? 有没有一种方法可以防止对Boost头文件(或什至对于尖括号中的任何头文件)生成依赖关系?

I read that earlier versions of gcc used to consider any headers in angle brackets as system headers, but that is no longer the case. 我读到gcc的较早版本曾经将尖括号中的所有标头都视为系统标头,但事实已不再如此。

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

(and man gcc :-) ) (和man gcc :-))

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

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