okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
5649b9e52
main
1# packaging/engine_targets.sh - the engine targets a configured build tree has (sourced, POSIX sh). 2# 3# targets=$(engine_targets <cmake> <build dir>) 4# "$cmake" --build "$build" --target $targets ... 5# 6# Prints "strata strata_kq" when the tree has the strata_kq target (libstrata_kq.so, the K-quant prompt kernels of a build with 7# llama.cpp's MMQ, -DSTRATA_MMQ=ON) and "strata" when it has not (STRATA_MMQ=OFF, the default). The build tree is asked 8# (a dry run of strata_kq), not the configure line: whether strata_kq exists also depends on STRATA_MMQ_KQUANTS and on defaults 9# the line need not name. Any other failure of the dry run stops the build instead of leaving the library out. 10engine_targets () { 11if _et_probe =$( " $ 1 " --build " $ 2 " --target strata_kq -- -n 2 >&1) ;then 12echo "strata strata_kq" 13return 0 14fi 15case " $ _et_probe " in 16 *"unknown target 'strata_kq'" *| *"No rule to make target" *strata_kq*)echo "strata" ;; 17 *)printf '%s\n' " $ _et_probe " >&2 18echo "engine_targets.sh: cannot tell whether the build tree $ 2 has the strata_kq target" >&2 19return 1 ;; 20esac 21}