summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordzaima <dzaimagit@gmail.com>2024-04-20 21:20:59 +0300
committerdzaima <dzaimagit@gmail.com>2024-04-20 21:20:59 +0300
commitce4461ff44b6aff5a6f53015bf0e16c8bde9960d (patch)
treeab11915c467c07ae9e3161a7a1a0ae55caa8a58f
parentd63e5ab7140dfc36cc178db0243b9f13cd0fcbc5 (diff)
build/build: handle dry-run clangd
-rwxr-xr-xbuild/src/build.bqn2
-rw-r--r--build/src/clangd.bqn11
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