|
|
|
|
@ -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) |
|
|
|
|
return it->path().string(); |
|
|
|
|
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,8 +121,10 @@ 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) |
|
|
|
|
return it->path().string(); |
|
|
|
|
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 {}; |
|
|
|
|
}(); |
|
|
|
|
|