dub.sdlsdl · 168 linesall
name "ui-app"
description "The application host for sparkles:ui: backend selection, the shared window/font CLI, and the frame/event loop, so an application never names a canvas"
license "BSL-1.0"

targetType "library"
targetPath "../../build"

importPaths "src"
sourcePaths "src"

dflags "-preview=in" "-preview=dip1000"

// The backend-free half. The concrete canvases arrive with a configuration.
dependency "sparkles:ui" path="../.."
dependency "sparkles:input" path="../.."
dependency "sparkles:appearance" path="../.."
dependency "sparkles:core-cli" path="../.."
// The loop substrate (event-horizon SPEC §15): the live arms run the frame
// loop as fibers on one ring wait. Backend-free code never touches it, and
// where loop creation fails at runtime the arms degrade to their plain
// blocking loops (SPEC §15.3) — the dependency is unconditional, the ring
// is not.
dependency "sparkles:event-horizon" path="../.."
dependency "sparkles:image" path="../.."
dependency "sparkles:font" path="../.."
// The font library's finder ranks families and faces (`font_library.d`).
dependency "sparkles:fuzzy" path="../.."
// Frame records and the named CPU zones every arm's frame opens (`PRF22`);
// it depends on `sparkles:base` alone.
dependency "sparkles:profiling" path="../.."

// ── Configurations (APP3) ───────────────────────────────────────────────────
//
// ORDER IS LOAD-BEARING: a consumer that declares no `subConfiguration` gets
// the FIRST configuration, so `tui` must stay at the top to be the default the
// spec promises. (Measured — see `UIAPP-O2`.)
//
// `gui` deliberately does NOT depend on `sparkles:ui-tui`: an Android build has
// no terminal and must not carry one in its closure.

configuration "tui" {
    dependency "sparkles:ui-tui" path="../.."
    versions "UiAppTui"
}

configuration "gui" {
    // Native shaping's pkg-config flags resolve at the executable boundary.
    targetType "sourceLibrary"
    dependency "sparkles:ui-raylib" path="../.."
    // The GPU backend needs the built-in effects' GPU halves; selected here,
    // beside it, so the `tui` configuration never asks for a shader compiler.
    subConfiguration "sparkles:ui" "gpu-effects"
    versions "UiAppGui"
}

// The native arm (`INT4`): `sparkles:wsi` windows drawn by `sparkles:ui-vulkan`,
// with no raylib on the drawing path. The cell font's file comes from
// `sparkles:raylib-text`'s resolver for now (its raylib-free `discovery` half)
// — an interim source the font library's catalog replaces — and is measured by
// `sparkles:font`.
configuration "gui-vulkan" {
    targetType "sourceLibrary"
    dependency "sparkles:ui-vulkan" path="../.."
    dependency "sparkles:vulkan-wsi" path="../.."
    dependency "sparkles:wsi" path="../.."
    dependency "sparkles:raylib-text" path="../.."
    subConfiguration "sparkles:raylib-text" "discovery"
    versions "UiAppGuiVulkan"
}

configuration "full" {
    targetType "sourceLibrary"
    dependency "sparkles:ui-tui" path="../.."
    dependency "sparkles:ui-raylib" path="../.."
    subConfiguration "sparkles:ui" "gpu-effects"
    versions "UiAppTui" "UiAppGui"
}

// The terminal and the native arm, for an application that, like the gallery,
// claims one `view` serves both.
configuration "full-vulkan" {
    targetType "sourceLibrary"
    dependency "sparkles:ui-tui" path="../.."
    dependency "sparkles:ui-vulkan" path="../.."
    dependency "sparkles:vulkan-wsi" path="../.."
    dependency "sparkles:wsi" path="../.."
    dependency "sparkles:font" path="../.."
    dependency "sparkles:raylib-text" path="../.."
    subConfiguration "sparkles:raylib-text" "discovery"
    versions "UiAppTui" "UiAppGuiVulkan"
}

configuration "unittest" {
    // The resilience catalog the suite checks itself against. `spec/` links
    // to it, so the catalog stays with the specification and the path stays
    // in this package (build-graph D24).
    stringImportPaths "spec"
    // The test build takes the widest closure, so every arm is compiled and
    // the recording target can be checked against both live ones.
    dependency "sparkles:ui-tui" path="../.."
    dependency "sparkles:ui-raylib" path="../.."
    subConfiguration "sparkles:ui" "gpu-effects"
    versions "UiAppTui" "UiAppGui" "UiAppGuiVulkan"
    dependency "sparkles:ui-vulkan" path="../.."
    dependency "sparkles:vulkan-wsi" path="../.."
    dependency "sparkles:wsi" path="../.."
    dependency "sparkles:font" path="../.."

    dependency "sparkles:test-runner" path="../.."
    dflags "-checkaction=context" "-allinst"
}

// BEGIN managed build types — apps/ci/tools/standardize-build-settings.d
dflags "--linker=lld" platform="linux-ldc"
dflags "-L-fuse-ld=lld" platform="linux-dmd"

buildType "unittest" {
    buildOptions "unittests" "debugMode" "debugInfo"
    dflags "--gline-tables-only" platform="ldc"
    dflags "-defaultlib=libphobos2.so" platform="linux-dmd"
    dflags "--link-defaultlib-shared" platform="linux-ldc"
    lflags "--export-dynamic" platform="linux-ldc"
}
buildType "unittest-debug" {
    buildOptions "unittests" "debugMode" "debugInfo"
    dflags "-defaultlib=libphobos2.so" platform="linux-dmd"
    dflags "--link-defaultlib-shared" platform="linux-ldc"
    lflags "--export-dynamic" platform="linux-ldc"
}
buildType "unittest-cov" {
    buildOptions "unittests" "coverage" "debugMode" "debugInfo"
    dflags "--gline-tables-only" platform="ldc"
    dflags "-defaultlib=libphobos2.so" platform="linux-dmd"
    dflags "--link-defaultlib-shared" platform="linux-ldc"
    lflags "--export-dynamic" platform="linux-ldc"
}
buildType "unittest-cov-ctfe" {
    buildOptions "unittests" "coverageCTFE" "debugMode" "debugInfo"
    dflags "--gline-tables-only" platform="ldc"
    dflags "-defaultlib=libphobos2.so" platform="linux-dmd"
    dflags "--link-defaultlib-shared" platform="linux-ldc"
    lflags "--export-dynamic" platform="linux-ldc"
}
buildType "checked" {
    buildOptions "optimize" "inline" "debugInfo"
}
buildType "bench" {
    buildOptions "unittests" "optimize" "inline"
    dflags "-mcpu=native" "-O3" "-allinst" platform="ldc"
    dflags "-defaultlib=libphobos2.so" platform="linux-dmd"
    dflags "--link-defaultlib-shared" platform="linux-ldc"
    lflags "--export-dynamic" platform="linux-ldc"
}
buildType "bench-unchecked" {
    buildOptions "unittests" "releaseMode" "optimize" "inline"
    dflags "-mcpu=native" "-O3" "-allinst" platform="ldc"
    dflags "-defaultlib=libphobos2.so" platform="linux-dmd"
    dflags "--link-defaultlib-shared" platform="linux-ldc"
    lflags "--export-dynamic" platform="linux-ldc"
}
buildType "bench-static" {
    buildOptions "unittests" "releaseMode" "optimize" "inline"
    dflags "-mcpu=native" "-O3" "-allinst" platform="ldc"
    dflags "--link-defaultlib-shared=false" platform="linux-ldc"
    dflags "-defaultlib=libphobos2.a" platform="linux-dmd"
    lflags "--export-dynamic" platform="linux-ldc"
}
// END managed build types