From e45345eeee4db91644a58842267393ff2df19fe2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 2 Mar 2017 11:23:35 +0200 Subject: Fix unit test code generation --- build2/buildfile | 8 +++++++- build2/cc/compile.cxx | 9 ++++----- build2/dummy.cxx | 8 ++++++++ 3 files changed, 19 insertions(+), 6 deletions(-) create mode 100644 build2/dummy.cxx (limited to 'build2') diff --git a/build2/buildfile b/build2/buildfile index a809a8b..a946bc7 100644 --- a/build2/buildfile +++ b/build2/buildfile @@ -93,7 +93,13 @@ test/script/{hxx ixx cxx}{ regex } \ test/script/{hxx cxx}{ runner } \ test/script/{hxx ixx cxx}{ script } \ test/script/{hxx cxx}{ token } \ - $libs + liba{b} $libs + +# Fake utility library (without it code generation does not work). +# +liba{b}: {cxx}{ dummy } +liba{b}: cxx.export.poptions = "-I$out_root" "-I$src_root" +liba{b}: install = false # Pass our compiler target to be used as build2 host. # diff --git a/build2/cc/compile.cxx b/build2/cc/compile.cxx index f202ba1..6493c61 100644 --- a/build2/cc/compile.cxx +++ b/build2/cc/compile.cxx @@ -516,9 +516,9 @@ namespace build2 { tracer trace (x, "compile::append_prefixes"); - // If this target does not belong to any project (e.g, an - // "imported as installed" library), then it can't possibly - // generate any headers for us. + // If this target does not belong to any project (e.g, an "imported as + // installed" library), then it can't possibly generate any headers for + // us. // const scope* rs (t.base_scope ().root_scope ()); if (rs == nullptr) @@ -554,8 +554,7 @@ namespace build2 l6 ([&]{trace << "-I '" << d << "'";}); - // If we are relative or not inside our project root, then - // ignore. + // If we are relative or not inside our project root, then ignore. // if (d.relative () || !d.sub (out_root)) continue; diff --git a/build2/dummy.cxx b/build2/dummy.cxx new file mode 100644 index 0000000..bdea9a9 --- /dev/null +++ b/build2/dummy.cxx @@ -0,0 +1,8 @@ +// file : build2/dummy.cxx -*- C++ -*- +// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +// license : MIT; see accompanying LICENSE file + +namespace build2 +{ + void dummy () {} +} -- cgit v1.1