[build2] Help with build2 project with subdirectories

Matheus D duarm0 at disroot.org
Sat Aug 19 20:51:33 UTC 2023


Hello, thanks for working in build2!

I have the following hierarchy, with irrelevant parts pruned

.
├── build/
│   ├── ...
├── buildfile
├── manifest
├── README.md
├── repositories.manifest
└── sakyra/
    ├── ds/
    │   ├── list.c
    │   ├── list.h
    ├── external/
    │   ├── miniaudio/
    │   │   ├── miniaudio.h
    │   ├── VulkanMemoryAllocator/
    │   │   ├── vk_mem_alloc.h
    │   ├── buildfile
    │   ├── json.h
    │   ├── stb_rect_pack.h
    │   ├── stb_truetype.h
    │   ├── stb_vorbis.h
    ├── extras/
    │   ├── audio.c
    │   ├── audio.h
    ├── buildfile
    ├── engine.c
    ├── engine.h
    ├── export.h
    ├── file.c
    ├── file.h
    └── version.h.in

>From my understading, the simple

`
lib{sakyra}: {hxx cxx}{**}
`

should be able to handle this, quoting the docs

`
In more complex projects it is often convenient to organize source code into subdirectories. To handle such projects we can use the recursive wildcard:

exe{hello}: {hxx cxx}{**}
`

But it doesn't work, I'm getting 

`
error: header stb_rect_pack.h not found and no rule to generate it
  info: failure deferred to compiler diagnostics
  info: re-run with --verbose=4 for more information
  info: while extracting header dependencies from sakyra/extras/c{text}@../sakyra-clang/sakyra/sakyra/extras/
  info: while applying rule c.compile to update ../sakyra-clang/sakyra/sakyra/extras/objs{text}
  info: while applying rule c.link to update ../sakyra-clang/sakyra/sakyra/libs{sakyra}
  info: while applying rule bin.lib to update ../sakyra-clang/sakyra/sakyra/lib{sakyra}
  info: while applying rule build.alias to update ../sakyra-clang/sakyra/dir{sakyra/}
  info: while applying rule build.alias to update ../sakyra-clang/dir{sakyra/}
`

one error for each file inside those sub directories. On my Makefile, I simply do
-I./sakyra/external/, and copy the tree as is (without the c files).

How to solve this, and why it doesn't work?



More information about the users mailing list