diff options
Diffstat (limited to 'odb-examples/schema/custom/buildfile')
-rw-r--r-- | odb-examples/schema/custom/buildfile | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/odb-examples/schema/custom/buildfile b/odb-examples/schema/custom/buildfile new file mode 100644 index 0000000..349da2c --- /dev/null +++ b/odb-examples/schema/custom/buildfile @@ -0,0 +1,44 @@ +# file : schema/custom/buildfile +# license : GNU GPL v2; see accompanying LICENSE file + +import libodb = libodb%lib{odb} + +import libs = libodb-$database%lib{odb-$database} + +exe{driver}: {hxx cxx}{* -employee-odb} {hxx ixx cxx}{employee-odb} testscript + +# The metadata library target which we use to extract the poptions variable +# value for specifying the preprocessor options (-I, etc) on the ODB compiler +# command line. +# +libue{employee-meta}: $libodb + +exe{driver}: libue{employee-meta} $libs + +<{hxx ixx cxx}{employee-odb}>: hxx{employee} libue{employee-meta} $odb +{{ + pops = $cxx.lib_poptions($<[1]) + depdb hash $pops + + $odb --std c++11 \ + --database $database \ + --generate-query \ + --generate-session \ + --default-pointer std::shared_ptr \ + --output-dir $out_base \ + "-I$src_base" $pops \ + $path($<[0]) +}} + +cxx.poptions =+ "-I$out_base" "-I$src_base" -DDATABASE_$ucase($database) + +# Testscript's run-time prerequisites. +# +# Note that while we don't create the schema using the database client +# utility, we still add this prerequisite since database-options.testscript +# requires that. +# +# @@ BUILD2: Eventually we should be able to mark it as test.input once +# this is supported for testscript tests. +# +exe{driver}: ../../alias{database-client}: include = adhoc |