Osmia is a busy little bee of a build script for meson projects
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dirkson d6f7f52e85 Improving clean behavior, fixing script locations 1 week ago
subprojects Improving clean behavior, fixing script locations 1 week ago
.gitignore Added dependency support 1 year ago
LICENSE Initial commit 1 year ago
README.md wording 1 week ago
build Improving clean behavior, fixing script locations 1 week ago

README.md

osmia

Osmia is a busy little bee of a build script for meson projects. It works around some of meson’s stranger design decisions.

Meson fills its directory with a mix of files you might want to interact with and meson internal files. Osmia provides “bin”, “lib”, and “doc” directories full of symlinks so that you don’t have to hunt around inside the meson build dir to find what you need.

Meson doesn’t provide tools to automatically procure and build dependencies without a meson file. This means that you cannot use a dependency without a meson build system. Osmia fills this gap with its ‘subprojects/dependencies’ file.

Meson sometimes requires one of two separate commands (“meson” or “ninja”) to build. Osmia figures out which command(s) currently need to be run to build and does it for you.

Using Meson alone, it’s unclear to users unfamilliar with meson how to build your software. By providing a simple ./build script that walks them through missing dependencies (meson, ninja, optionally ccache), osmia makes it easier for end users to build your software.

At the time of this writing, meson will attempt to use ccache, but will stop using it once you specify some different compiler to back it with. Osmia attempts to guess the compiler you want, (Clang, GCC, others) but can also be told to use a specific compiler with “COMPILER=”. When specifying a compiler this way, ccache will still be automatically used if available.

Osmia stays out of Meson’s way, so you can always use the standard Meson/ninja build commands instead of or in addition to the osmia wrapper.

Usage

Drop the “build” file into your project at the root directory and run it (“./build”) when you want to build.

./build [-mode] [target]

Target will be passed to ninja directly

Mode defaults to ‘release’, or can be one of the following:

  • -? -h --help
    • Prints out a help dialogue
  • -r --release
    • Builds using meson’s release mode. Default.
  • -d --debug
    • Builds using meson’s debug mode, with --werror added
  • -c --clean
    • Cleans up current project meson/ninja/osmia files
  • -fc --full-clean
    • Cleans up current project AND subproject meson/ninja/osmia files
  • -w --win --windows
    • Cross-compiles for win32 using scripts/win32cross.txt
  • -w64 --win64 --windows64
    • Cross-compiles for win64 using scripts/win64.txt
  • -o --osx
    • TODO. Cross-compile for OSX using scripts/osx.txt

Osmia will return appropriately when called, so you can do constructs such as: ./build -d && ./bin/mytest

TODO

  • Improve dependency system, including recursive dependencies.
  • If meson exposes some way to specify compiler alongside ccache, deprecate the COMPILER= option.
  • Currently ‘fullclean’ does the wrong thing. It should do the right thing.

Goals

The end goal of this thing is basically to lose all its features to Meson over time. For example, there’s no reason I can see that calling ‘meson’ again shouldn’t just run ninja for you.