Browse Source

Further improvements to libclang's resource path

merge-requests/413/head
eidheim 3 years ago
parent
commit
70b01ba867
  1. 8
      src/compile_commands.cpp

8
src/compile_commands.cpp

@ -87,8 +87,10 @@ std::vector<std::string> CompileCommands::get_arguments(const boost::filesystem:
#if defined(__APPLE__)
static auto resource_path = []() -> std::string {
boost::system::error_code ec;
for(boost::filesystem::directory_iterator it(boost::filesystem::path(LIBCLANG_LIBRARY_DIR) / "clang", ec), end; it != end; ++it)
for(boost::filesystem::directory_iterator it(boost::filesystem::path(LIBCLANG_LIBRARY_DIR) / "clang", ec), end; it != end; ++it) {
if(boost::filesystem::is_directory(it->path() / "include", ec))
return it->path().string();
}
return {};
}();
if(!resource_path.empty()) {
@ -119,9 +121,11 @@ std::vector<std::string> CompileCommands::get_arguments(const boost::filesystem:
}
else {
boost::system::error_code ec;
for(boost::filesystem::directory_iterator it(boost::filesystem::path(LIBCLANG_LIBRARY_DIR) / "clang", ec), end; it != end; ++it)
for(boost::filesystem::directory_iterator it(boost::filesystem::path(LIBCLANG_LIBRARY_DIR) / "clang", ec), end; it != end; ++it) {
if(boost::filesystem::is_directory(it->path() / "include", ec))
return it->path().string();
}
}
return {};
}();
if(!resource_path.empty()) {

Loading…
Cancel
Save