Skip to content

Source Bundles and Targets

A Quxlang build is described by a source bundle. The compiler does not discover installed libraries or accept optimization flags that silently change an artifact; modules, target properties, options, and output settings belong to the bundle configuration.

Directory shape

A minimal bundle follows this layout:

example-bundle/
├── qxcbuild.yml
└── modules/
    ├── app/
    │   └── sources/
    │       └── main.qxs
    ├── runtime/
    │   └── sources/
    │       └── ...
    └── std/
        └── sources/
            └── ...

The directories under modules/ are source modules. A target maps logical module names used by source code to those source modules.

Target and output configuration

targets:
  linux-x64:
    platform: linux
    cpu: x64
    backend: llvm
    modules:
      RUNTIME:
        source: runtime
      std:
        source: std
      app:
        source: app
outputs:
  linux-x64/app:
    target: linux-x64
    type: executable
    main_module: app
    backend_llvm_options:
      build_type: Release

The target name is linux-x64. Its logical app, std, and RUNTIME modules resolve to source directories with the same names here, but a target may map a logical name to a versioned or platform-specific source module.

The linux-x64/app output key is the exact path below ./out/output, and its target field selects linux-x64. An executable output selects a main module. A unit_test_suite output instead lists modules whose UNIT_TEST declarations should be collected.

Configured target compilation

qxc ./example-bundle ./out

The invocation compiles every configured target and writes artifacts to ./out/output/<output-key>. A comma-separated target list, such as qxc ./example-bundle ./out linux-x64, restricts compilation to selected targets. The --debug-compile-output option emits compiler-stage artifacts for diagnosis.

See Source files and imports, the qxcbuild.yml overview, Build options, and Availability and target selection.