Welcome to the BUSY build system
BUSY (for BUild SYstem) is a lean, cross-platform build system for the GCC, Clang and MSVC toolchains, with very little system requirements and easy bootsrapping.
Compared to other build systems like CMake, QMake, Meson or GN, BUSY is characterized by a statically typed build specification language, and by the possibility to build a project directly from scratch without any further requirements to the host system; BUSY is so lean that it is even suited to be directly integrated with the source tree of a project.
Here is an example project using BUSY: https://github.com/rochus-keller/nappgui/. NAppGUI is an extensive cross-platform GUI library written in C89 (with parts in C++98 and Objective-C) by Francisco García. See the README on how to build the project and check the BUSY files in the root and the src directory (and subdirectories). See below and in the syntax directory for more information about the specification language. Those who know GN will recognize various concepts in BUSY.
Here are a few excerpts for convenience:
# from the top-level BUSY file submod src let shared_lib* = src.shared_lib let static_lib* = src.static_lib let all! : Group { .deps = [ shared_lib static_lib ] # since 'let' is used the 'deps' field can only be set here using the '.' prefix # if 'var' is used instead it could be modified elsewhere with 'all.deps += xyz' }
# from the src BUSY file let main_config - : Config { .include_dirs += [ ./geom2d ./osbs ./sewer /* just a few shown */ ] .defines += [ "NAPPGUI_LIBRARY" "NAPPGUI_BUILD_DIR=\"" + tostring(root_build_dir) + "\"" "NAPPGUI_BUILD=\"" + readstring('../prj/build.txt') + "\"" ] } submod core submod draw2d # and many more let all_lib_sources : Group { # only visible in this BUSY file .deps = [ core.sources draw2d.sources # and many more ] } let static_lib* : Library { .name = "NAppGUI" # otherwise the binary would be named "static_lib" .lib_type = `static .deps = [ all_lib_sources ] }
# from the draw2d BUSY file submod gtk3 let sources * : SourceSet { .sources = [ ./draw2d.cpp ./drawg.cpp ./btext.c # and many more ] .configs += ^main_config # this references the Config in the src BUSY file if target_os == `linux { .deps += gtk3.sources }else if target_os == `win32 { # and on and on }else { error("target os not supported") } }
Also this syntax version is valid (for people who prefer the Pascal style):
let sources * : SourceSet begin .sources := [ ./draw2d.cpp ./drawg.cpp ./btext.c ] if target_os == `linux then .deps += gtk3.sources elsif target_os == `win32 then # and on and on else error("target os not supported") end end
... continue reading