diff options
author | dzaima <dzaimagit@gmail.com> | 2024-04-20 21:20:59 +0300 |
---|---|---|
committer | dzaima <dzaimagit@gmail.com> | 2024-04-20 21:20:59 +0300 |
commit | ce4461ff44b6aff5a6f53015bf0e16c8bde9960d (patch) | |
tree | ab11915c467c07ae9e3161a7a1a0ae55caa8a58f | |
parent | d63e5ab7140dfc36cc178db0243b9f13cd0fcbc5 (diff) |
build/build: handle dry-run clangd
-rwxr-xr-x | build/src/build.bqn | 2 | ||||
-rw-r--r-- | build/src/clangd.bqn | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/build/src/build.bqn b/build/src/build.bqn index f3f27d4e..5134e828 100755 --- a/build/src/build.bqn +++ b/build/src/build.bqn @@ -795,7 +795,7 @@ cachedBin‿linkerCache ← { outPath ← •wdpath •file.At po.output { - po.clangd? clangd.Finish@; + po.clangd? clangd.Finish ¬po.dry; # else, regular build success ← Run cachedBin { 𝕊: diff --git a/build/src/clangd.bqn b/build/src/clangd.bqn index c213478c..74b38391 100644 --- a/build/src/clangd.bqn +++ b/build/src/clangd.bqn @@ -82,14 +82,19 @@ ModifyCBQNFlags ← { } objects ← ⟨⟩ -Finish ⇐ { 𝕊: +Finish ⇐ { 𝕊 write: objects ModifyCBQNFlags⌾(({"src/"≡4↑⊑𝕩}¨ objects)⊸/)↩ FileObj ← { name‿flags: "file"‿"directory"‿"arguments" JObj ⟨JStr name, JStr AtRoot "", ", " JArr JStr¨ flags⟩ } res ← (","∾n) JArr FileObj¨ objects resPath ← AtRoot "compile_commands.json" - resPath •FChars res - •Out "Wrote clangd compile commands to "∾•file.At resPath + { + write? + resPath •FChars res + •Out "Wrote clangd compile commands to "∾•file.At resPath + ; + •Out "Would write clangd compile commands to "∾•file.At resPath + } } _add ⇐ {objects∾↩ <⟨𝕩, (𝔽@)∾<𝕩⟩}
\ No newline at end of file |