Skip to content

Instantly share code, notes, and snippets.

@valgur
Created October 14, 2024 05:56
Show Gist options
  • Save valgur/0a1c865131697bbea73d1343b7a0c6cf to your computer and use it in GitHub Desktop.
Save valgur/0a1c865131697bbea73d1343b7a0c6cf to your computer and use it in GitHub Desktop.
#!/bin/bash
set -o errexit -o nounset -o pipefail
if [ -f conandata.yml ]; then
dir=.
elif [ -f ../conandata.yml ]; then
dir=..
elif [ -f ../../conandata.yml ]; then
dir=../..
elif [ -f meson/conandata.yml ]; then
dir=meson
elif [ -f cmake/conandata.yml ]; then
dir=cmake
elif [ -f all/conandata.yml ]; then
dir=all
else
dir=$(dirname "$(find -name conandata.yml | LC_ALL=C sort | tail -1)")
fi
export CLICOLOR=1
export CLICOLOR_FORCE=1
version=$(yq -r '.sources | keys[]' -- $dir/conandata.yml | sort --version-sort | tail -1 || yq -r '.versions | keys[]' -- $dir/../config.yml | sort --version-sort | tail -1)
profile=gcc-cci
conan create $dir --version "$version" --build missing -pr:b gcc-cci -pr $profile "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment