From e263a308313e2a6102c0c226c5d4ed4536d96794 Mon Sep 17 00:00:00 2001 From: eidheim Date: Tue, 12 Jan 2016 20:38:19 +0100 Subject: [PATCH] No longer attempts to create build directory when opening a file without CMakeLists.txt in the same directory --- src/source_clang.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/source_clang.cc b/src/source_clang.cc index 8180d53..d2d5beb 100644 --- a/src/source_clang.cc +++ b/src/source_clang.cc @@ -179,7 +179,11 @@ void Source::ClangViewParse::soft_reparse() { } std::vector 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); std::vector cmds = commands.get_commands(); std::vector arguments;