diff --git a/src/cmake.cpp b/src/cmake.cpp index 793eadb..06efaf2 100644 --- a/src/cmake.cpp +++ b/src/cmake.cpp @@ -149,8 +149,7 @@ bool CMake::update_debug_build(const boost::filesystem::path &debug_build_path, boost::filesystem::path CMake::get_executable(const boost::filesystem::path &build_path, const boost::filesystem::path &file_path) { // Prefer the CMake file API (if available) which gives exact information about the targets a file belongs to - auto executable = get_executable_from_file_api(build_path, file_path); - if(executable) + if(auto executable = get_executable_from_file_api(build_path, file_path)) return *executable; // CMake does not store in compile_commands.json if an object is part of an executable or not.