diff options
27 files changed, 85 insertions, 60 deletions
diff --git a/odb-examples/access/buildfile b/odb-examples/access/buildfile index e59adda..5001f97 100644 --- a/odb-examples/access/buildfile +++ b/odb-examples/access/buildfile @@ -5,10 +5,11 @@ import libodb = libodb%lib{odb} import libs = libodb-$database%lib{odb-$database} -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{person-odb} testscript +exe{driver}: {hxx cxx}{* -person-odb} {hxx ixx cxx}{person-odb} testscript # The metadata library target which we use to extract the poptions variable -# value for specifying the contained options on the ODB compiler command line. +# value for specifying the preprocessor options (-I, etc) on the ODB compiler +# command line. # libue{person-meta}: $libodb diff --git a/odb-examples/c++11/README b/odb-examples/c++11/README index 7db6a44..638b9a2 100644 --- a/odb-examples/c++11/README +++ b/odb-examples/c++11/README @@ -27,8 +27,8 @@ employee.sql These files are generated by the ODB compiler from employee.hxx using the following command line: - odb --std c++11 -d <database> --std c++11 --generate-schema \ - --generate-query employee.hxx + odb --std c++11 -d <database> --generate-schema --generate-query \ + employee.hxx Where <database> stands for the database system we are using, for example, 'mysql'. @@ -51,8 +51,8 @@ driver.cxx over the result printing basic information about the returned objects. To compile and link the example manually from the command line we can use -the following commands (using MySQL as an example; replace 'c++ -std=c++11' -with your C++ compiler in C++11 mode): +the following commands (using MySQL as an example; replace 'c++' with your +C++ compiler name): c++ -c employee-odb.cxx c++ -DDATABASE_MYSQL -c driver.cxx diff --git a/odb-examples/c++11/buildfile b/odb-examples/c++11/buildfile index 5287801..e921434 100644 --- a/odb-examples/c++11/buildfile +++ b/odb-examples/c++11/buildfile @@ -5,10 +5,11 @@ import libodb = libodb%lib{odb} import libs = libodb-$database%lib{odb-$database} -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{employee-odb} testscript +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 contained options on the ODB compiler command line. +# value for specifying the preprocessor options (-I, etc) on the ODB compiler +# command line. # libue{employee-meta}: $libodb diff --git a/odb-examples/composite/buildfile b/odb-examples/composite/buildfile index 5eb45ad..7d21db6 100644 --- a/odb-examples/composite/buildfile +++ b/odb-examples/composite/buildfile @@ -5,10 +5,11 @@ import libodb = libodb%lib{odb} import libs = libodb-$database%lib{odb-$database} -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{person-odb} testscript +exe{driver}: {hxx cxx}{* -person-odb} {hxx ixx cxx}{person-odb} testscript # The metadata library target which we use to extract the poptions variable -# value for specifying the contained options on the ODB compiler command line. +# value for specifying the preprocessor options (-I, etc) on the ODB compiler +# command line. # libue{person-meta}: $libodb diff --git a/odb-examples/container/buildfile b/odb-examples/container/buildfile index c850acc..a045a3b 100644 --- a/odb-examples/container/buildfile +++ b/odb-examples/container/buildfile @@ -5,10 +5,11 @@ import libodb = libodb%lib{odb} import libs = libodb-$database%lib{odb-$database} -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{person-odb} testscript +exe{driver}: {hxx cxx}{* -person-odb} {hxx ixx cxx}{person-odb} testscript # The metadata library target which we use to extract the poptions variable -# value for specifying the contained options on the ODB compiler command line. +# value for specifying the preprocessor options (-I, etc) on the ODB compiler +# command line. # libue{person-meta}: $libodb diff --git a/odb-examples/hello/buildfile b/odb-examples/hello/buildfile index db76837..e6ad903 100644 --- a/odb-examples/hello/buildfile +++ b/odb-examples/hello/buildfile @@ -5,10 +5,11 @@ import libodb = libodb%lib{odb} import libs = libodb-$database%lib{odb-$database} -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{person-odb} testscript +exe{driver}: {hxx cxx}{* -person-odb} {hxx ixx cxx}{person-odb} testscript # The metadata library target which we use to extract the poptions variable -# value for specifying the contained options on the ODB compiler command line. +# value for specifying the preprocessor options (-I, etc) on the ODB compiler +# command line. # libue{person-meta}: $libodb diff --git a/odb-examples/inheritance/polymorphism/buildfile b/odb-examples/inheritance/polymorphism/buildfile index a501043..eaf21c9 100644 --- a/odb-examples/inheritance/polymorphism/buildfile +++ b/odb-examples/inheritance/polymorphism/buildfile @@ -5,10 +5,11 @@ import libodb = libodb%lib{odb} import libs = libodb-$database%lib{odb-$database} -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{employee-odb} testscript +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 contained options on the ODB compiler command line. +# value for specifying the preprocessor options (-I, etc) on the ODB compiler +# command line. # libue{employee-meta}: $libodb diff --git a/odb-examples/inheritance/reuse/buildfile b/odb-examples/inheritance/reuse/buildfile index 15df240..7190d39 100644 --- a/odb-examples/inheritance/reuse/buildfile +++ b/odb-examples/inheritance/reuse/buildfile @@ -5,10 +5,11 @@ import libodb = libodb%lib{odb} import libs = libodb-$database%lib{odb-$database} -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{employee-odb} testscript +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 contained options on the ODB compiler command line. +# value for specifying the preprocessor options (-I, etc) on the ODB compiler +# command line. # libue{employee-meta}: $libodb diff --git a/odb-examples/inverse/README b/odb-examples/inverse/README index e2c43f7..57fcdd0 100644 --- a/odb-examples/inverse/README +++ b/odb-examples/inverse/README @@ -30,7 +30,7 @@ employee.sql The --generate-session option is used to enable session support for all the persistent classes in employee.hxx. The --default-pointer option is - used to make shared_ptr the default object pointer. + used to make std::shared_ptr the default object pointer. database.hxx Contains the create_database() function which instantiates the concrete diff --git a/odb-examples/inverse/buildfile b/odb-examples/inverse/buildfile index 3661ed3..a113004 100644 --- a/odb-examples/inverse/buildfile +++ b/odb-examples/inverse/buildfile @@ -5,10 +5,11 @@ import libodb = libodb%lib{odb} import libs = libodb-$database%lib{odb-$database} -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{employee-odb} testscript +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 contained options on the ODB compiler command line. +# value for specifying the preprocessor options (-I, etc) on the ODB compiler +# command line. # libue{employee-meta}: $libodb diff --git a/odb-examples/mapping/buildfile b/odb-examples/mapping/buildfile index f7803f4..77d7b1a 100644 --- a/odb-examples/mapping/buildfile +++ b/odb-examples/mapping/buildfile @@ -5,10 +5,11 @@ import libodb = libodb%lib{odb} import libs = libodb-$database%lib{odb-$database} -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{person-odb} testscript +exe{driver}: {hxx cxx}{* -person-odb} {hxx ixx cxx}{person-odb} testscript # The metadata library target which we use to extract the poptions variable -# value for specifying the contained options on the ODB compiler command line. +# value for specifying the preprocessor options (-I, etc) on the ODB compiler +# command line. # libue{person-meta}: $libodb diff --git a/odb-examples/optimistic/buildfile b/odb-examples/optimistic/buildfile index 505068e..576fff6 100644 --- a/odb-examples/optimistic/buildfile +++ b/odb-examples/optimistic/buildfile @@ -5,10 +5,11 @@ import libodb = libodb%lib{odb} import libs = libodb-$database%lib{odb-$database} -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{person-odb} testscript +exe{driver}: {hxx cxx}{* -person-odb} {hxx ixx cxx}{person-odb} testscript # The metadata library target which we use to extract the poptions variable -# value for specifying the contained options on the ODB compiler command line. +# value for specifying the preprocessor options (-I, etc) on the ODB compiler +# command line. # libue{person-meta}: $libodb diff --git a/odb-examples/pimpl/buildfile b/odb-examples/pimpl/buildfile index b6f8a88..3191c3a 100644 --- a/odb-examples/pimpl/buildfile +++ b/odb-examples/pimpl/buildfile @@ -5,10 +5,11 @@ import libodb = libodb%lib{odb} import libs = libodb-$database%lib{odb-$database} -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{person-odb} testscript +exe{driver}: {hxx cxx}{* -person-odb} {hxx ixx cxx}{person-odb} testscript # The metadata library target which we use to extract the poptions variable -# value for specifying the contained options on the ODB compiler command line. +# value for specifying the preprocessor options (-I, etc) on the ODB compiler +# command line. # libue{person-meta}: $libodb diff --git a/odb-examples/prepared/buildfile b/odb-examples/prepared/buildfile index 1347236..c167735 100644 --- a/odb-examples/prepared/buildfile +++ b/odb-examples/prepared/buildfile @@ -5,10 +5,11 @@ import libodb = libodb%lib{odb} import libs = libodb-$database%lib{odb-$database} -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{person-odb} testscript +exe{driver}: {hxx cxx}{* -person-odb} {hxx ixx cxx}{person-odb} testscript # The metadata library target which we use to extract the poptions variable -# value for specifying the contained options on the ODB compiler command line. +# value for specifying the preprocessor options (-I, etc) on the ODB compiler +# command line. # libue{person-meta}: $libodb diff --git a/odb-examples/query/buildfile b/odb-examples/query/buildfile index 2585145..7dcd0e2 100644 --- a/odb-examples/query/buildfile +++ b/odb-examples/query/buildfile @@ -5,10 +5,11 @@ import libodb = libodb%lib{odb} import libs = libodb-$database%lib{odb-$database} -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{person-odb} testscript +exe{driver}: {hxx cxx}{* -person-odb} {hxx ixx cxx}{person-odb} testscript # The metadata library target which we use to extract the poptions variable -# value for specifying the contained options on the ODB compiler command line. +# value for specifying the preprocessor options (-I, etc) on the ODB compiler +# command line. # libue{person-meta}: $libodb diff --git a/odb-examples/relationship/README b/odb-examples/relationship/README index 0e175b3..1f517bd 100644 --- a/odb-examples/relationship/README +++ b/odb-examples/relationship/README @@ -26,7 +26,7 @@ employee.sql The --generate-session option is used to enable session support for all the persistent classes in employee.hxx. The --default-pointer option is - used to make shared_ptr the default object pointer. + used to make std::shared_ptr the default object pointer. database.hxx Contains the create_database() function which instantiates the concrete diff --git a/odb-examples/relationship/buildfile b/odb-examples/relationship/buildfile index 32d292a..2b4ffed 100644 --- a/odb-examples/relationship/buildfile +++ b/odb-examples/relationship/buildfile @@ -5,10 +5,11 @@ import libodb = libodb%lib{odb} import libs = libodb-$database%lib{odb-$database} -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{employee-odb} testscript +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 contained options on the ODB compiler command line. +# value for specifying the preprocessor options (-I, etc) on the ODB compiler +# command line. # libue{employee-meta}: $libodb diff --git a/odb-examples/relationship/employee.hxx b/odb-examples/relationship/employee.hxx index cc03971..4133c05 100644 --- a/odb-examples/relationship/employee.hxx +++ b/odb-examples/relationship/employee.hxx @@ -6,7 +6,7 @@ #include <vector> #include <string> -#include <memory> // shared_ptr +#include <memory> // std::shared_ptr #include <odb/core.hxx> diff --git a/odb-examples/schema/custom/README b/odb-examples/schema/custom/README index b5e9af4..73fc1cc 100644 --- a/odb-examples/schema/custom/README +++ b/odb-examples/schema/custom/README @@ -25,7 +25,7 @@ employee-odb.cxx The --generate-session option is used to enable session support for all the persistent classes in employee.hxx. The --default-pointer option is - used to make shared_ptr the default object pointer. + used to make std::shared_ptr the default object pointer. database.hxx Contains the create_database() function which instantiates the concrete diff --git a/odb-examples/schema/custom/buildfile b/odb-examples/schema/custom/buildfile index 8248866..349da2c 100644 --- a/odb-examples/schema/custom/buildfile +++ b/odb-examples/schema/custom/buildfile @@ -5,10 +5,11 @@ import libodb = libodb%lib{odb} import libs = libodb-$database%lib{odb-$database} -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{employee-odb} testscript +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 contained options on the ODB compiler command line. +# value for specifying the preprocessor options (-I, etc) on the ODB compiler +# command line. # libue{employee-meta}: $libodb @@ -19,13 +20,10 @@ exe{driver}: libue{employee-meta} $libs pops = $cxx.lib_poptions($<[1]) depdb hash $pops - depdb dyndep --dyn-target --target-what 'generated schema' --format lines \ - -- echo ($sqlite ? '' : "$out_base/employee.sql") - $odb --std c++11 \ --database $database \ - --generate-schema \ --generate-query \ + --generate-session \ --default-pointer std::shared_ptr \ --output-dir $out_base \ "-I$src_base" $pops \ @@ -36,9 +34,11 @@ 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 - -testscript@./: schema = employee diff --git a/odb-examples/schema/custom/testscript b/odb-examples/schema/custom/testscript index 0f5cafc..a482025 100644 --- a/odb-examples/schema/custom/testscript +++ b/odb-examples/schema/custom/testscript @@ -2,10 +2,11 @@ # license : GNU GPL v2; see accompanying LICENSE file .include ../../database-options.testscript -.include ../../$(database).testscript -+if! $sqlite - $create_schema +test.arguments += $($(database)_options) + ++if $sqlite + test.cleanups += &odb-test.db end : basics diff --git a/odb-examples/schema/embedded/buildfile b/odb-examples/schema/embedded/buildfile index b1bc449..79a45a0 100644 --- a/odb-examples/schema/embedded/buildfile +++ b/odb-examples/schema/embedded/buildfile @@ -5,10 +5,11 @@ import libodb = libodb%lib{odb} import libs = libodb-$database%lib{odb-$database} -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{person-odb} testscript +exe{driver}: {hxx cxx}{* -person-odb} {hxx ixx cxx}{person-odb} testscript # The metadata library target which we use to extract the poptions variable -# value for specifying the contained options on the ODB compiler command line. +# value for specifying the preprocessor options (-I, etc) on the ODB compiler +# command line. # libue{person-meta}: $libodb @@ -34,9 +35,11 @@ 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 - -testscript@./: schema = person diff --git a/odb-examples/schema/embedded/testscript b/odb-examples/schema/embedded/testscript index 7d403e6..1310f1b 100644 --- a/odb-examples/schema/embedded/testscript +++ b/odb-examples/schema/embedded/testscript @@ -2,7 +2,12 @@ # license : GNU GPL v2; see accompanying LICENSE file .include ../../database-options.testscript -.include ../../$(database).testscript + +test.arguments += $($(database)_options) + ++if $sqlite + test.cleanups += &odb-test.db +end : basics : diff --git a/odb-examples/section/buildfile b/odb-examples/section/buildfile index 09bf305..104ea30 100644 --- a/odb-examples/section/buildfile +++ b/odb-examples/section/buildfile @@ -5,10 +5,11 @@ import libodb = libodb%lib{odb} import libs = libodb-$database%lib{odb-$database} -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{person-odb} testscript +exe{driver}: {hxx cxx}{* -person-odb} {hxx ixx cxx}{person-odb} testscript # The metadata library target which we use to extract the poptions variable -# value for specifying the contained options on the ODB compiler command line. +# value for specifying the preprocessor options (-I, etc) on the ODB compiler +# command line. # libue{person-meta}: $libodb diff --git a/odb-examples/view/README b/odb-examples/view/README index ef47dfe..1ea1842 100644 --- a/odb-examples/view/README +++ b/odb-examples/view/README @@ -29,9 +29,9 @@ employee.sql Where <database> stands for the database system we are using, for example, 'mysql'. - The --default-pointer option is used to make shared_ptr the default object - pointer. The --generate-session option is used to enable session support - for all the objects which is required to use object loading views. + The --default-pointer option is used to make std::shared_ptr the default + object pointer. The --generate-session option is used to enable session + support for all the objects which is required to use object loading views. database.hxx Contains the create_database() function which instantiates the concrete diff --git a/odb-examples/view/buildfile b/odb-examples/view/buildfile index 11f5d5b..51e07ba 100644 --- a/odb-examples/view/buildfile +++ b/odb-examples/view/buildfile @@ -5,10 +5,11 @@ import libodb = libodb%lib{odb} import libs = libodb-$database%lib{odb-$database} -exe{driver}: {hxx cxx}{* -*-odb -*-odb-*} {hxx ixx cxx}{employee-odb} testscript +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 contained options on the ODB compiler command line. +# value for specifying the preprocessor options (-I, etc) on the ODB compiler +# command line. # libue{employee-meta}: $libodb diff --git a/odb-examples/view/employee.hxx b/odb-examples/view/employee.hxx index 3087b62..5add690 100644 --- a/odb-examples/view/employee.hxx +++ b/odb-examples/view/employee.hxx @@ -5,7 +5,7 @@ #define EMPLOYEE_HXX #include <string> -#include <memory> // shared_ptr +#include <memory> // std::shared_ptr #include <cstddef> // std::size_t #include <odb/core.hxx> |