1

I am new to build2 and following along thair toolchain introduction.

I currently have the following structure:

demo/
- build/
  - bootstrap.build
  - root.build
- demo/
  - main.cpp
  - buildfile
- buildfile
- ...

./build/bootstrap.build:

project = demo

using version
using config
using test
using install
using dist

./build/root.build:

cxx.std = 20

using cxx

hxx{*}: extension = hpp
cxx{*}: extension = cpp

./buildfile:

./: {*/ -build/}

./demo/buildfile:

exe{demo}: {hxx cxx}{*}

When I run b everything works but all the binry and metadata file get put into ./demo.

But when I run b demo/@demo-out/ I get the following error:

error: out_base suffix does not match src_root
  info: src_root: .\
  info: out_base: out\

As I am new to build2 I dont quite get what I am missing.

Symlink
  • 383
  • 2
  • 12

1 Answers1

0

I just ran into the exact same situation, and discovered that the system is expecting you to invoke the command from the directory above the project. (Which, in hindsight, makes sense since it's describing an out-of-tree build.) See this example:

❯ bdep new -l c++ -t exe demo
created new executable project demo in /Users/xxx/projects/demo/

> cd demo

> b
c++ demo/cxx{demo}
ld demo/exe{demo}

> b demo/@demo-out/
error: out_base suffix does not match src_root
  info: src_root: ./
  info: out_base: demo-out/

> cd ..

> b demo/@demo-out/
mkdir fsdir{demo-out/}
mkdir demo-out/fsdir{demo/}
c++ demo/demo/cxx{demo}@demo-out/demo/
ld demo-out/demo/exe{demo}
David Harks
  • 730
  • 4
  • 5