Last active
August 19, 2022 15:34
-
-
Save andmax/77f7ab62a6bb2bf160b0afbf1ed2e454 to your computer and use it in GitHub Desktop.
clangd to teach emacs c++
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install clangd to have IDE support in emacs: | |
https://clangd.llvm.org/ | |
Add following snippet to ~/.emacs: | |
(require 'eglot) | |
(add-to-list 'eglot-server-programs '((c++-mode c-mode) "clangd")) | |
(add-hook 'c-mode-hook 'eglot-ensure) | |
(add-hook 'c++-mode-hook 'eglot-ensure) | |
Create file ~/.clangd with: | |
CompileFlags: | |
Add: | |
[ | |
'--cuda-gpu-arch=sm_80', | |
'--cuda-path=/usr/local/cuda', | |
'--include-dir=/usr/local/cuda/include', | |
'-std=c++17' | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment