Browse Source

No longer adds -fretain-comments-from-system-headers when using pch file. Related to #394

merge-requests/391/head
eidheim 7 years ago
parent
commit
b9b31c3c93
  1. 4
      src/compile_commands.cc

4
src/compile_commands.cc

@ -1,5 +1,6 @@
#include "compile_commands.h" #include "compile_commands.h"
#include "clangmm.h" #include "clangmm.h"
#include <algorithm>
#include <boost/property_tree/json_parser.hpp> #include <boost/property_tree/json_parser.hpp>
#include <regex> #include <regex>
@ -136,6 +137,9 @@ std::vector<std::string> CompileCommands::get_arguments(const boost::filesystem:
arguments.emplace_back("-I" + (boost::filesystem::path(env_msystem_prefix) / "lib/clang" / clang_version / "include").string()); arguments.emplace_back("-I" + (boost::filesystem::path(env_msystem_prefix) / "lib/clang" / clang_version / "include").string());
#endif #endif
} }
// Do not add -fretain-comments-from-system-headers if pch is used, since the pch was most likely made without this flag
if(std::none_of(arguments.begin(), arguments.end(), [](const std::string &argument) { return argument == "-include-pch"; }))
arguments.emplace_back("-fretain-comments-from-system-headers"); arguments.emplace_back("-fretain-comments-from-system-headers");
if(is_header) { if(is_header) {

Loading…
Cancel
Save