簡體   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