/bin/twn: devcompl command to generate clangd completions in root

This commit is contained in:
veclavtalica 2025-02-22 20:29:28 +03:00
parent 62866d33ae
commit d5aec5e6e1
31 changed files with 19 additions and 8 deletions

View File

@ -1,3 +1,3 @@
[[deps]] [[deps]]
source = "../../../common-data" source = "../../../data"
name = "common-data" name = "common-data"

View File

@ -1,3 +1,3 @@
[[deps]] [[deps]]
source = "../../../common-data" # where does it come from, might be an url source = "../../../data" # where does it come from, might be an url
name = "common-data" # should be globally unique name = "common-data" # should be globally unique

View File

@ -1,3 +1,3 @@
[[deps]] [[deps]]
source = "../../../common-data" # where does it come from, might be an url source = "../../../data" # where does it come from, might be an url
name = "common-data" # should be globally unique name = "common-data" # should be globally unique

View File

@ -1,3 +1,3 @@
[[deps]] [[deps]]
source = "../../common-data" # where does it come from, might be an url source = "../../data" # where does it come from, might be an url
name = "common-data" # should be globally unique name = "common-data" # should be globally unique

View File

@ -57,6 +57,9 @@ case "$1" in
fi fi
;; ;;
devcompl ) (cd "$TWNROOT" && "$toolpath"/twnbuild "--build_dir=$TWNROOT/build" "${@:2}")
;;
* ) echo "Unknown command." * ) echo "Unknown command."
;; ;;
esac esac

View File

@ -5,6 +5,7 @@ from os import getcwd
from os.path import expandvars from os.path import expandvars
from pathlib import Path from pathlib import Path
from sys import argv from sys import argv
from functools import reduce
import tomllib import tomllib
#TODO: support for default pack override #TODO: support for default pack override
@ -16,8 +17,9 @@ has_clang = getoutput("command -v clang") != ""
target_web = "--target=web" in argv target_web = "--target=web" in argv
#TODO: infer what "native" means for current env #TODO: infer what "native" means for current env
build_dir = "build/web" if target_web else "build/native" build_dir_arg = reduce(lambda c, n: c if c.startswith("--build_dir=") else n, argv + [""], "")
build_dir += "/release" if "--release" in argv else "/debug" build_dir = "build/web" if target_web else build_dir_arg.split("=")[1] if build_dir_arg else "build/native"
build_dir += "" if build_dir_arg else "/release" if "--release" in argv else "/debug"
cmake = ["emcmake", "cmake"] if target_web else ["cmake"] cmake = ["emcmake", "cmake"] if target_web else ["cmake"]
# cmake configuration command # cmake configuration command

BIN
data/assets/dirt/1.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
data/assets/dirt/2.png (Stored with Git LFS) Normal file

Binary file not shown.