SC::Build can be used outside of the Sane C++ repository through the SC-build.sh, SC-build.bat, and SC-build.ps1 launchers.
External projects provide a regular SC-build.cpp build-definition file and let the launcher resolve a SaneCppLibraries checkout to compile and run it.
The launcher supports three layouts:
ThirdParty/SaneCppLibraries--libraries-root <path>The project entry file is always named SC-build.cpp.
Minimal external project:
Example SC-build.cpp:
parameters.directories.projectDirectory is the project root discovered by the launcher.
parameters.directories.libraryDirectory is the SaneCppLibraries checkout that provides the generic build driver and the public headers.
Vendored checkout:
Invoke from the project root or any nested subdirectory:
Explicit shared checkout:
Standalone downloaded launcher:
Windows PowerShell:
When testing a non-main branch, download the launcher from that branch and pin the same branch in SC-build.cpp:
When the launcher uses the shared cache flow, it reads the requested SaneCppLibraries revision from a comment pragma in SC-build.cpp:
The value can be a tag, branch, or commit SHA.
If the pragma is missing, the launcher resolves the latest default-branch revision and prints a warning because that mode is less reproducible.
If --libraries-root and SC_BUILD_LIBRARIES_ROOT are both absent, the standalone launcher uses a shared cache:
$XDG_CACHE_HOME/sc-build or ~/.cache/sc-buildLOCALAPPDATA%\SC-buildThe cache stores:
SaneCppLibrariesOverrides:
--libraries-root <path>: use an explicit checkout and disable cache resolution--project-dir <path>: choose the project root explicitly instead of searching upward from the current directorySC_BUILD_LIBRARIES_ROOT: environment variable equivalent of --libraries-rootSC_BUILD_CACHE_DIR: override the shared cache base directoryCannot find SC-build.cpp: run the launcher from inside the project tree or pass --project-dir <path>Cannot resolve SaneCppLibraries revision: fix the // sc-build-version: ... pragma or use --libraries-rootgit is required: install git or use --libraries-root pointing at an existing checkoutToolsBootstrap build failures: make sure a working host compiler is installed and availableparameters.directories.projectDirectory as the project root