|
|
|
|
@ -23,11 +23,16 @@ CompileCommands::FindSystemIncludePaths::FindSystemIncludePaths() {
|
|
|
|
|
if(line.back() == '\r') |
|
|
|
|
line.pop_back(); |
|
|
|
|
#endif |
|
|
|
|
auto end = line.find(" (framework directory)", 1); |
|
|
|
|
if(end == std::string::npos) |
|
|
|
|
include_paths.emplace_back(line.substr(1, end)); |
|
|
|
|
else |
|
|
|
|
framework_paths.emplace_back(line.substr(1, end)); |
|
|
|
|
if(ends_with(line, " (framework directory)")) |
|
|
|
|
framework_paths.emplace_back(line.substr(1, line.size() - 22 - 1)); |
|
|
|
|
else { |
|
|
|
|
#ifdef __APPLE__ |
|
|
|
|
// Workaround for missing resource-dir
|
|
|
|
|
if(line == " /Library/Developer/CommandLineTools/usr/lib/clang/14.0.3/include") |
|
|
|
|
resource_path = "/Library/Developer/CommandLineTools/usr/lib/clang/14.0.3"; |
|
|
|
|
#endif |
|
|
|
|
include_paths.emplace_back(line.substr(1)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
return; |
|
|
|
|
@ -176,6 +181,10 @@ std::vector<std::string> CompileCommands::get_arguments(const boost::filesystem:
|
|
|
|
|
|
|
|
|
|
static FindSystemIncludePaths system_include_paths; |
|
|
|
|
if(system_include_paths) { |
|
|
|
|
if(!system_include_paths.resource_path.empty()) { |
|
|
|
|
arguments.emplace_back("-resource-dir"); |
|
|
|
|
arguments.emplace_back(system_include_paths.resource_path); |
|
|
|
|
} |
|
|
|
|
for(auto &path : system_include_paths.include_paths) |
|
|
|
|
arguments.emplace_back("-I" + sysroot + path); |
|
|
|
|
for(auto &path : system_include_paths.framework_paths) |
|
|
|
|
|