mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 01:07:45 +01:00
Fix clang-tidy with multiple ESP32 toolchains installed (#2998)
This commit is contained in:
parent
c8f4fbb7dd
commit
193d3e0206
1 changed files with 6 additions and 2 deletions
|
@ -58,10 +58,14 @@ def clang_options(idedata):
|
|||
# defines
|
||||
cmd.extend(f'-D{define}' for define in idedata['defines'])
|
||||
|
||||
# add include directories, using -isystem for dependencies to suppress their errors
|
||||
# add toolchain include directories using -isystem
|
||||
# idedata contains include directories for all toolchains of this platform, only use those from the one in use
|
||||
toolchain_dir = os.path.normpath(f"{idedata['cxx_path']}/../../")
|
||||
for directory in idedata['includes']['toolchain']:
|
||||
if 'xtensa-esp32s2-elf' not in directory:
|
||||
if directory.startswith(toolchain_dir):
|
||||
cmd.extend(['-isystem', directory])
|
||||
|
||||
# add include directories, using -isystem for dependencies to suppress their errors
|
||||
for directory in sorted(set(idedata['includes']['build'])):
|
||||
dependency = "framework-arduino" in directory or "/libdeps/" in directory
|
||||
cmd.extend(['-isystem' if dependency else '-I', directory])
|
||||
|
|
Loading…
Reference in a new issue