|
|
|
@ -81,9 +81,12 @@ CompileCommands::CompileCommands(const boost::filesystem::path &build_path) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
std::vector<std::string> CompileCommands::get_arguments(const boost::filesystem::path &build_path, const boost::filesystem::path &file_path) { |
|
|
|
std::vector<std::string> CompileCommands::get_arguments(const boost::filesystem::path &build_path, const boost::filesystem::path &file_path) { |
|
|
|
|
|
|
|
std::string default_std_argument="-std=c++1y"; |
|
|
|
|
|
|
|
|
|
|
|
std::vector<std::string> arguments; |
|
|
|
std::vector<std::string> arguments; |
|
|
|
if(!build_path.empty()) { |
|
|
|
if(!build_path.empty()) { |
|
|
|
clangmm::CompilationDatabase db(build_path.string()); |
|
|
|
clangmm::CompilationDatabase db(build_path.string()); |
|
|
|
|
|
|
|
if(db) { |
|
|
|
clangmm::CompileCommands commands(file_path.string(), db); |
|
|
|
clangmm::CompileCommands commands(file_path.string(), db); |
|
|
|
auto cmds = commands.get_commands(); |
|
|
|
auto cmds = commands.get_commands(); |
|
|
|
for (auto &cmd : cmds) { |
|
|
|
for (auto &cmd : cmds) { |
|
|
|
@ -102,6 +105,12 @@ std::vector<std::string> CompileCommands::get_arguments(const boost::filesystem: |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
arguments.emplace_back(default_std_argument); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
arguments.emplace_back(default_std_argument); |
|
|
|
|
|
|
|
|
|
|
|
auto clang_version_string=clangmm::to_string(clang_getClangVersion()); |
|
|
|
auto clang_version_string=clangmm::to_string(clang_getClangVersion()); |
|
|
|
const static std::regex clang_version_regex("^[A-Za-z ]+([0-9.]+).*$"); |
|
|
|
const static std::regex clang_version_regex("^[A-Za-z ]+([0-9.]+).*$"); |
|
|
|
std::smatch sm; |
|
|
|
std::smatch sm; |
|
|
|
|