redguardtoo / cpputils-cmake

Easy real time C++ syntax check and intellisense if you use CMake
196 stars 28 forks source link

Fix for projects not using cmake #71

Open berhoel opened 7 years ago

berhoel commented 7 years ago

Although some of my software projects use cmake not all do. For those projects who do not, the irony support in cpputils-cmake causes problems. This patch fixes the warnings for me:

*** cpputils-cmake.el_SAVE  2016-09-29 10:00:01.803673300 +0200
--- cpputils-cmake.el   2016-12-01 09:35:42.905213897 +0100
***************
*** 723,727 ****

      ;; irony compile-commands-path
!     (if (fboundp 'irony-cdb-json-add-compile-commands-path)
          (irony-cdb-json-add-compile-commands-path cppcm-src-dir (concat cppcm-build-dir "compile_commands.json")))

--- 723,728 ----

      ;; irony compile-commands-path
!     (if (and cppcm-src-dir
!              (fboundp 'irony-cdb-json-add-compile-commands-path))
          (irony-cdb-json-add-compile-commands-path cppcm-src-dir (concat cppcm-build-dir "compile_commands.json")))
redguardtoo commented 7 years ago

Which one is correct version , the above one or below one?

berhoel commented 7 years ago

The below. irony-cdb-json-add-compile-commands-path fails if cppcm-src-dir is nil.

berhoel commented 7 years ago

72

Reference to pull request fixing the above issue.

redguardtoo commented 7 years ago

thanks