summaryrefslogtreecommitdiff
path: root/BUILDING.md
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-10-28 09:23:12 +1100
committerjacqueline <me@jacqueline.id.au>2023-10-28 09:23:12 +1100
commit6ef0fa2b1b75f2afd3beaf112b6a29a989ce49d8 (patch)
treea2830e4989b61822a0c426f9e623b0249cba7962 /BUILDING.md
parent4e0aaa825b94636fd063de31692eb3ca5738fe9e (diff)
downloadtangara-fw-6ef0fa2b1b75f2afd3beaf112b6a29a989ce49d8.tar.gz
improve on clangd setup instructions
Diffstat (limited to 'BUILDING.md')
-rw-r--r--BUILDING.md27
1 files changed, 8 insertions, 19 deletions
diff --git a/BUILDING.md b/BUILDING.md
index 8e4427ab..1557b366 100644
--- a/BUILDING.md
+++ b/BUILDING.md
@@ -69,35 +69,24 @@ A regular build will generate `build/compile_commands.json`, which clangd will
automatically pick up. However, there are a couple of additional steps to get
everything to play nicely.
-First, you will need to download the xtensa clang toolchain. You can do this
-via ESP-IDF by running `idf_tools.py install xtensa-clang`
-
-This will install their prebuild clang into a path like `~/.espressif/tools/xtensa-clang/VERSION/xtensa-esp32-elf-clang/`
-
-Next, you will need to configure clangd to use this version of clang, plus
-forcible remove a couple of GCC-specific build flags. Do this by creating
-`.clangd` in the root directory of your project, with contents like so:
+First, create a `.clangd` file in the this directory, with contents like:
```
CompileFlags:
Add: [
- -ferror-limit=0,
- -I/Users/YOU/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32-elf/include,
- -I/Users/YOU/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32-elf/xtensa-esp32-elf/include,
- -I/Users/YOU/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/8.4.0,
- -I/Users/YOU/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/8.4.0/xtensa-esp32-elf,
- -isysroot=/Users/YOU/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32-elf/xtensa-esp32-elf,
+ -D__XTENSA__,
+ --target=mipsel-linux-gnu,
]
Remove: [
- -Wduplicated-cond,
- -Wduplicated-branches,
- -Wlogical-op,
-fno-tree-switch-conversion,
- -mtext-section-literals,
-mlongcalls,
-fstrict-volatile-bitfields,
]
- Compiler: /Users/YOU/.espressif/tools/xtensa-clang/esp-clang/bin/clang++
```
+You may need to tweak the `target` flag until `clangd` is happy to build.
+
+If you get errors involving missing C++ includes, then you may need to edit
+your editor's LSP invocation to include `--query-driver=**`.
+
You should then get proper LSP integration via clangd.