Browse Source

No longer attempts to create build directory when opening a file without CMakeLists.txt in the same directory

merge-requests/365/head
eidheim 10 years ago
parent
commit
e263a30831
  1. 6
      src/source_clang.cc

6
src/source_clang.cc

@ -179,7 +179,11 @@ void Source::ClangViewParse::soft_reparse() {
} }
std::vector<std::string> Source::ClangViewParse::get_compilation_commands() { std::vector<std::string> Source::ClangViewParse::get_compilation_commands() {
clang::CompilationDatabase db(CMake::get_default_build_path(project_path).string()); boost::filesystem::path default_build_path;
if(boost::filesystem::exists(project_path/"CMakeLists.txt"))
default_build_path=CMake::get_default_build_path(project_path);
clang::CompilationDatabase db(default_build_path.string());
clang::CompileCommands commands(file_path.string(), db); clang::CompileCommands commands(file_path.string(), db);
std::vector<clang::CompileCommand> cmds = commands.get_commands(); std::vector<clang::CompileCommand> cmds = commands.get_commands();
std::vector<std::string> arguments; std::vector<std::string> arguments;

Loading…
Cancel
Save