-
Notifications
You must be signed in to change notification settings - Fork 319
/
.ycm_extra_conf.py
40 lines (31 loc) · 1.13 KB
/
.ycm_extra_conf.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# YouCompleteMe (https://github.com/ycm-core/YouCompleteMe) configuration file
# that enables it to find the LLVM and Python includes from a conda
# environment, independent of the Conda environment location and Python and
# LLVM versions.
import os
import sys
from pathlib import Path
CONDA_PREFIX = os.environ['CONDA_PREFIX']
LLVMLITE_DIR = Path(__file__).parent
VER = sys.version_info
PYTHON_INCLUDE_NAME = f'python{VER.major}.{VER.minor}'
CONDA_INCLUDE_DIR = Path(CONDA_PREFIX, 'include')
PYTHON_INCLUDE_DIR = Path(CONDA_INCLUDE_DIR, PYTHON_INCLUDE_NAME)
FFI_DIR = Path(LLVMLITE_DIR, 'ffi')
flags = [
# Include dirs
f'-I{CONDA_INCLUDE_DIR}',
f'-I{PYTHON_INCLUDE_DIR}',
f'-I{FFI_DIR}',
# C++ standard to which LLVM 14 is developed
'-std=c++14',
# Force language to C++ so that core.h is treated as C++
'-x', 'c++',
]
# This function is called by YCM to obtain the config from this file.
def Settings(**kwargs):
return {'flags': flags}
# Executing this configuration file standalone outside of YCM prints the
# settings to aid with debugging the configuration.
if __name__ == '__main__':
print(Settings())