|
|
|
@ -107,14 +107,22 @@ std::vector<std::string> CompileCommands::get_arguments(const boost::filesystem: |
|
|
|
} |
|
|
|
} |
|
|
|
#else |
|
|
|
#else |
|
|
|
static auto resource_path = []() -> std::string { |
|
|
|
static auto resource_path = []() -> std::string { |
|
|
|
std::stringstream stdin_stream, stdout_stream; |
|
|
|
if(!filesystem::find_executable("clang++").empty()) { |
|
|
|
auto exit_status = Terminal::get().process(stdin_stream, stdout_stream, "clang++ -print-resource-dir"); |
|
|
|
std::stringstream stdin_stream, stdout_stream; |
|
|
|
if(exit_status != 0) |
|
|
|
auto exit_status = Terminal::get().process(stdin_stream, stdout_stream, "clang++ -print-resource-dir"); |
|
|
|
return {}; |
|
|
|
if(exit_status != 0) |
|
|
|
auto path = stdout_stream.str(); |
|
|
|
return {}; |
|
|
|
if(!path.empty()) |
|
|
|
auto path = stdout_stream.str(); |
|
|
|
path.pop_back(); |
|
|
|
if(!path.empty()) |
|
|
|
return path; |
|
|
|
path.pop_back(); |
|
|
|
|
|
|
|
return path; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
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(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return {}; |
|
|
|
}(); |
|
|
|
}(); |
|
|
|
if(!resource_path.empty()) { |
|
|
|
if(!resource_path.empty()) { |
|
|
|
arguments.emplace_back("-resource-dir"); |
|
|
|
arguments.emplace_back("-resource-dir"); |
|
|
|
|