From 4b4bb9ad9fe08dbec5dc0f8bfc946331a4b13da6 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 15 Oct 2021 19:51:16 +0300 Subject: Mark headers as importable in buildfiles Drop @ from bin.lib.version in libhello/buildfile Add commented out c/cxx/cc.internal.scope to root.build Make glue buildfile to read packages.manifest Fortify tests against NDEBUG Add BMI extensions to and ignore compressed .i and .i in .gitignore Bump project requirements for build2 to 0.14.0- --- buildfile | 3 ++- libhello/.gitignore | 5 +++++ libhello/build/root.build | 8 ++++++++ libhello/libhello/buildfile | 12 +++++++----- libhello/manifest | 4 ++-- libhello/tests/basics/driver.cxx | 4 +++- libhello/tests/build/root.build | 4 ++++ 7 files changed, 31 insertions(+), 9 deletions(-) diff --git a/buildfile b/buildfile index aad5e21..c3c8909 100644 --- a/buildfile +++ b/buildfile @@ -1,5 +1,6 @@ # Glue buildfile that "pulls" all the packages in the project. # -import pkgs = */ +import pkgs = [dir_paths] $process.run_regex(\ + cat $src_root/packages.manifest, '\s*location\s*:\s*(\S+)\s*', '\1') ./: $pkgs diff --git a/libhello/.gitignore b/libhello/.gitignore index cece09c..6435b97 100644 --- a/libhello/.gitignore +++ b/libhello/.gitignore @@ -3,9 +3,14 @@ *.d *.t *.i +*.i.* *.ii +*.ii.* *.o *.obj +*.gcm +*.pcm +*.ifc *.so *.dll *.a diff --git a/libhello/build/root.build b/libhello/build/root.build index 9c83a8a..ae3d2a6 100644 --- a/libhello/build/root.build +++ b/libhello/build/root.build @@ -1,3 +1,7 @@ +# Uncomment to suppress warnings coming from external libraries. +# +#cxx.internal.scope = current + cxx.std = latest using cxx @@ -7,6 +11,10 @@ ixx{*}: extension = ixx txx{*}: extension = txx cxx{*}: extension = cxx +# Assume headers are importable unless stated otherwise. +# +hxx{*}: cxx.importable = true + # The test target for cross-testing (running tests under Wine, etc). # test.target = $cxx.target diff --git a/libhello/libhello/buildfile b/libhello/libhello/buildfile index 04e8d20..28dc070 100644 --- a/libhello/libhello/buildfile +++ b/libhello/libhello/buildfile @@ -1,6 +1,6 @@ intf_libs = # Interface dependencies. impl_libs = # Implementation dependencies. -#import impl_libs += libhello%lib{hello} +#import xxxx_libs += libhello%lib{hello} lib{hello}: {hxx ixx txx cxx}{** -version} hxx{version} $impl_libs $intf_libs @@ -14,12 +14,14 @@ hxx{version}: in{version} $src_root/manifest clean = ($src_root != $out_root) } +hxx{export}@./: cxx.importable = false + # Build options. # cxx.poptions =+ "-I$out_root" "-I$src_root" -obja{*}: cxx.poptions += -DLIBHELLO_STATIC_BUILD -objs{*}: cxx.poptions += -DLIBHELLO_SHARED_BUILD +{hbmia obja}{*}: cxx.poptions += -DLIBHELLO_STATIC_BUILD +{hbmis objs}{*}: cxx.poptions += -DLIBHELLO_SHARED_BUILD # Export options. # @@ -37,9 +39,9 @@ libs{hello}: cxx.export.poptions += -DLIBHELLO_SHARED # for details on the version.* variable values. # if $version.pre_release - lib{hello}: bin.lib.version = @"-$version.project_id" + lib{hello}: bin.lib.version = "-$version.project_id" else - lib{hello}: bin.lib.version = @"-$version.major.$version.minor" + lib{hello}: bin.lib.version = "-$version.major.$version.minor" # Install into the libhello/ subdirectory of, say, /usr/include/ # recreating subdirectories. diff --git a/libhello/manifest b/libhello/manifest index e8d6a0e..165445f 100644 --- a/libhello/manifest +++ b/libhello/manifest @@ -14,5 +14,5 @@ src-url: https://git.build2.org/cgit/hello/libhello/tree/libhello?h=1.0 email: users@build2.org build-warning-email: builds@build2.org builds: all -depends: * build2 >= 0.11.0 -depends: * bpkg >= 0.11.0 +depends: * build2 >= 0.14.0- +depends: * bpkg >= 0.14.0- diff --git a/libhello/tests/basics/driver.cxx b/libhello/tests/basics/driver.cxx index a7ef847..c41adff 100644 --- a/libhello/tests/basics/driver.cxx +++ b/libhello/tests/basics/driver.cxx @@ -1,10 +1,12 @@ -#include #include #include #include #include +#undef NDEBUG +#include + int main () { using namespace std; diff --git a/libhello/tests/build/root.build b/libhello/tests/build/root.build index a67b2fe..8fafbfe 100644 --- a/libhello/tests/build/root.build +++ b/libhello/tests/build/root.build @@ -7,6 +7,10 @@ ixx{*}: extension = ixx txx{*}: extension = txx cxx{*}: extension = cxx +# Assume headers are importable unless stated otherwise. +# +hxx{*}: cxx.importable = true + # Every exe{} in this subproject is by default a test. # exe{*}: test = true -- cgit v1.1