Skip to content

scd build

Compiles an SPM project for the specified target platform. Accepts SPM Build Options for controlling the build configuration, compiler flags, and linked libraries. The output is placed in the Product subdirectory of the project by default.

scd build [options]
OptionDescription
-p, --pathPath to the SPM project. Defaults to current directory
-c, --configurationBuild configuration: Debug (default) or Release
--platformTarget platform. See Platforms
--build-dirPath to build directory. Defaults to .build
-o, --outputPath to output directory. Defaults to Product subdirectory
--os-versionMinimum OS version or Android API level
--static-swift-stdlibLink with static Swift standard library
--debug-info-formatDebug info format: dwarf (default), codeview, or none
--sdkPath to target SDK sysroot
--pkg-config-pathAdditional pkg-config search paths
--verboseEnable verbose output

All commands also accept Global Options.

Terminal window
# Build for macOS (default)
scd build
# Build for Android ARM64
scd build --platform android-arm64-v8a