Sunday 15 August 2010

gcc - CMake (cotire) precompiled headers and disable warnings -


I am using the cotire () plugin for seamkak, which handles many good things related to compiling speed ( For example precompiled headers).

The problem is that I include several headers (Boost related or Protobuf) in the form of a system - in which warnings are disabled.

I do not think there are a built-in method to do this, when we compile "-w" To add a flag, the cotire function has modified cotire_add_pch_compilation_flags (line 1244 cotire.cmake version 1.5.1) precompold header we have GNU | To read the clang section

  elseif (_compilerID MATCHES "GNU | clang") # gcc / clag option used to specify # -x source language # -compiled but do not link Set the file set (_xLanguage_C "c-header") in the # -o location output (_xLanguage_CXX "c ++ - header") if (_flags) # Add to list (append_flag "-x" "$ {_ xLanguage _ $ {_ Language}} "- $" _ $ {_ prefix} "" "$ {_ prefixFile}" -o "$ {_ pchFile}") and () # return string as set (_flags " X $ {_xLanguage _ $ {_ language}} -w - C \ "$ {_ prefixFile} \" -o \ "$ {_ pchFile} \" ") endif ()   

It suppresses all warnings for us, we have many warnings going on - including terror, so it was a mandatory change!

No comments:

Post a Comment