diff options
Diffstat (limited to 'odb/build')
-rw-r--r-- | odb/build/.gitignore | 3 | ||||
-rw-r--r-- | odb/build/bootstrap.build | 10 | ||||
-rw-r--r-- | odb/build/export.build | 9 | ||||
-rw-r--r-- | odb/build/root.build | 110 |
4 files changed, 132 insertions, 0 deletions
diff --git a/odb/build/.gitignore b/odb/build/.gitignore new file mode 100644 index 0000000..4a730a3 --- /dev/null +++ b/odb/build/.gitignore @@ -0,0 +1,3 @@ +config.build +root/ +bootstrap/ diff --git a/odb/build/bootstrap.build b/odb/build/bootstrap.build new file mode 100644 index 0000000..9e30b56 --- /dev/null +++ b/odb/build/bootstrap.build @@ -0,0 +1,10 @@ +# file : build/bootstrap.build +# license : GNU GPL v3; see accompanying LICENSE file + +project = odb + +using version +using config +using dist +using test +using install diff --git a/odb/build/export.build b/odb/build/export.build new file mode 100644 index 0000000..6293a45 --- /dev/null +++ b/odb/build/export.build @@ -0,0 +1,9 @@ +# file : build/export.build +# license : GNU GPL v3; see accompanying LICENSE file + +$out_root/ +{ + include odb/ +} + +export $out_root/odb/exe{odb} diff --git a/odb/build/root.build b/odb/build/root.build new file mode 100644 index 0000000..86a02a0 --- /dev/null +++ b/odb/build/root.build @@ -0,0 +1,110 @@ +# file : build/root.build +# license : GNU GPL v3; see accompanying LICENSE file + +# This configuration variable can be used to specify the GCC plugin directory +# instead of auto-discovering it with -print-file-name=plugin. Primarily +# useful when dealing with cross-compilation. +# +config [dir_path, config.report.variable=plugin_dir] \ + config.odb.plugin_dir ?= [null] + +# This configuration variable can be used to specify the GCC g++ executable +# name that will be called by the ODB compiler instead of auto-deriving it +# from config.cxx. Primarily useful when dealing with cross-compilation. +# +config [string, config.report.variable=gxx_name] \ + config.odb.gxx_name ?= [null] + +config [bool] config.odb.develop ?= false + +develop = $config.odb.develop + +define cli: file +cli{*}: extension = cli + +cxx.std = latest + +using cxx + +hxx{*}: extension = hxx +ixx{*}: extension = ixx +txx{*}: extension = txx +cxx{*}: extension = cxx + +if ($cxx.target.system == 'win32-msvc') + cxx.poptions += -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS + +if ($cxx.class == 'msvc') + cxx.coptions += /wd4251 /wd4275 /wd4800 + +cxx.poptions =+ "-I$out_root" "-I$src_root" + +# Specify the test target for cross-testing. +# +test.target = $cxx.target + +# Omit the rest during the skeleton load. +# +if ($build.mode != 'skeleton') +{ + if ($cxx.id != 'gcc') + fail 'ODB compiler can only be built with GCC' + + # Determine the GCC plugin directory unless specified explicitly. + # + if ($config.odb.plugin_dir != [null]) + plugin_dir = $config.odb.plugin_dir + else + { + # If plugin support is disabled, then -print-file-name will print the name + # we have passed (the real plugin directory will always be absolute). + # + plugin_dir = [dir_path] $process.run($cxx.path -print-file-name=plugin) + + if ("$plugin_dir" == plugin) + fail "$recall($cxx.path) does not support plugins" + } + + # It can also include '..' components (e.g., on Windows) so normalize it for + # good measure. + # + plugin_dir = $normalize($plugin_dir) + + # Determine the g++ executable name unless specified explicitly. + # + if ($config.odb.gxx_name != [null]) + gxx_name = $config.odb.gxx_name + else + { + # Unless cross-compiling, pass the C++ compiler's recall path as the g++ + # name. + # + # Note that we used to compare complete target triplets but that prooved + # too strict. For example, we may be running on x86_64-apple-darwin17.7.0 + # while the compiler is targeting x86_64-apple-darwin17.3.0. + # + if ($cxx.target.cpu == $build.host.cpu && \ + $cxx.target.system == $build.host.system) + { + gxx_name = $recall($cxx.path) + } + else + fail "g++ executable name must be specified explicitly with \ +config.odb.gxx_name when cross-compiling" + } + + # Extract the copyright notice from the LICENSE file. + # + # Note that cat is a builtin which means this is both portable and fast. + # + copyright = $process.run_regex(cat $src_root/LICENSE, \ + 'Copyright \(c\) (.+)\.', \ + '\1') +} +else +{ + # Set for report. + # + plugin_dir = [null] + gxx_name = [null] +} |