atilaneves/cmake-ide

Issues with path separators on Windows

CraftedCart opened this issue · 1 comments

Hello
It seems that on Windows, at least when running Emacs/CMake within MSYS2, the flycheck-clang-* options fail to be set (They're all nil) because of issues with mixed path separators. The idb hash table contains keys using \\ separators, whereas the variable file-name in the function cide--idb-file-to-obj uses / separators.

As a quick-n-dirty solution for now, I've just put in a regex replace in that function and all seems to be working.

(defun cide--idb-file-to-obj (idb file-name)
  "Get object from IDB for FILE-NAME."
  (car (gethash (replace-regexp-in-string "/" "\\" file-name t t) idb)))

CMake ide version: 20180713.1513
Emacs version: 26.1 (From the mingw-w64-x86_64-emacs package from MSYS2)
Pile of configs courtesy of Spacemacs
Value of cmake-ide-cmake-opts: "-G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++"

I can't reproduce this since it would involve me setting up MSYS2.