From 423f8752de65d91cc1f89eda1408022a305df2f9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 9 Jul 2018 09:53:01 +0200 Subject: Adjust ODB compilation script for bdep-based setup --- libbrep/odb.sh | 72 +++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 49 insertions(+), 23 deletions(-) (limited to 'libbrep') diff --git a/libbrep/odb.sh b/libbrep/odb.sh index 3234899..d4e6604 100755 --- a/libbrep/odb.sh +++ b/libbrep/odb.sh @@ -3,47 +3,73 @@ trap 'exit 1' ERR odb=odb -lib="\ --I$HOME/work/odb/builds/default/libodb-pgsql-default \ --I$HOME/work/odb/libodb-pgsql \ --I$HOME/work/odb/builds/default/libodb-default \ --I$HOME/work/odb/libodb" +inc=() -$odb $lib -d pgsql --std c++14 --generate-query \ +if test -d ../.bdep; then + + # Use default configuration for headers. + # + cfg="$(bdep config list -d .. | \ +sed -r -ne 's#^(@[^ ]+ )?([^ ]+)/ .*default.*$#\2#p')" + + inc+=("-I$(echo "$cfg"/libodb-[1-9]*/)") + inc+=("-I$(echo "$cfg"/libodb-pgsql-[1-9]*/)") + + inc+=("-I$cfg/libbutl") + inc+=("-I../../libbutl") + + inc+=("-I$cfg/libbpkg") + inc+=("-I../../libbpkg") + + inc+=("-I$cfg/libbbot") + inc+=("-I../../libbbot") + + inc+=("-I$cfg/brep") + inc+=("-I..") + +else + + inc+=("-I$HOME/work/odb/builds/default/libodb-pgsql-default") + inc+=("-I$HOME/work/odb/libodb-pgsql") + + inc+=("-I$HOME/work/odb/builds/default/libodb-default") + inc+=("-I$HOME/work/odb/libodb") + + inc+=(-I.. -I../../libbbot -I../../libbpkg -I../../libbutl) + +fi + +$odb "${inc[@]}" -d pgsql --std c++14 --generate-query \ --odb-epilogue '#include ' \ --hxx-prologue '#include ' \ --hxx-prologue '#include ' \ -DLIBODB_BUILD2 -DLIBODB_PGSQL_BUILD2 \ - -I .. -I ../../libbbot -I ../../libbpkg -I ../../libbutl \ --include-with-brackets --include-prefix libbrep \ --guard-prefix LIBBREP \ common.hxx -$odb $lib -d pgsql --std c++14 --generate-query --generate-schema \ - --schema-format sql --schema-format embedded --schema-name package \ - --odb-epilogue '#include ' \ - --hxx-prologue '#include ' \ - --generate-prepared -DLIBODB_BUILD2 -DLIBODB_PGSQL_BUILD2 \ - -I .. -I ../../libbbot -I ../../libbpkg -I ../../libbutl \ - --include-with-brackets --include-prefix libbrep \ - --guard-prefix LIBBREP \ +$odb "${inc[@]}" -d pgsql --std c++14 --generate-query --generate-schema \ + --schema-format sql --schema-format embedded --schema-name package \ + --odb-epilogue '#include ' \ + --hxx-prologue '#include ' \ + --generate-prepared -DLIBODB_BUILD2 -DLIBODB_PGSQL_BUILD2 \ + --include-with-brackets --include-prefix libbrep \ + --guard-prefix LIBBREP \ package.hxx xxd -i package-extra.hxx -$odb $lib -d pgsql --std c++14 --generate-query --generate-schema \ - --schema-format sql --schema-format embedded --schema-name build \ - --odb-epilogue '#include ' \ - --generate-prepared -DLIBODB_BUILD2 -DLIBODB_PGSQL_BUILD2 \ - -I .. -I ../../libbbot -I ../../libbpkg -I ../../libbutl \ - --include-with-brackets --include-prefix libbrep \ +$odb "${inc[@]}" -d pgsql --std c++14 --generate-query --generate-schema \ + --schema-format sql --schema-format embedded --schema-name build \ + --odb-epilogue '#include ' \ + --generate-prepared -DLIBODB_BUILD2 -DLIBODB_PGSQL_BUILD2 \ + --include-with-brackets --include-prefix libbrep \ --guard-prefix LIBBREP \ build.hxx -$odb $lib -d pgsql --std c++14 --generate-query \ +$odb "${inc[@]}" -d pgsql --std c++14 --generate-query \ --odb-epilogue '#include ' \ --generate-prepared -DLIBODB_BUILD2 -DLIBODB_PGSQL_BUILD2 \ - -I .. -I ../../libbbot -I ../../libbpkg -I ../../libbutl \ --include-with-brackets --include-prefix libbrep \ --guard-prefix LIBBREP \ build-package.hxx -- cgit v1.1