diff --git a/build b/build index 1ce17d4..09a84f9 100755 --- a/build +++ b/build @@ -1,7 +1,19 @@ #!/bin/sh -e -export COSMO="${COSMO:-/opt/cosmo}" -export COSMOS="${COSMOS:-/opt/cosmos}" +COSMOS="${COSMOS:-/opt/cosmos}" +if ! [ -d "${COSMOS}" ] && [ -f "${COSMOS}/bin/cosmocc" ] +then + if ! command -v cosmocc >/dev/null + then + echo "You need to add cosmopolitan toolchain to your environment variable:" + echo "export COSMOS=/opt/cosmos" + exit 1 + fi + + COSMOS="$(dirname "$(dirname "$(command -v cosmocc)")")" + export COSMOS +fi +export COSMOS FLAGS="-I deps/sokol \ -I deps/cimgui \