meson-compile-targets — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited meson-compile-targets (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
meson compile command builds targets using the configured backend (ninja, Visual Studio, Xcode). It supports target selection, parallelism, verbosity control, and backend-specific flags.
Build everything:
meson compile -C buildBuild specific target:
meson compile -C build target_name
meson compile -C build path/to/target:executableUse all CPU cores:
meson compile -C build -j 0 # 0 = detect CPU count
meson compile -C build -j 8 # 8 parallel jobsVerbose output (show commands):
meson compile -C build -vClean before rebuild:
meson compile -C build --cleanmeson compile [options] [targets...]| Option | Purpose | Example |
|---|---|---|
-C BUILDDIR | Build directory | -C build |
-j JOBS | Parallel jobs (0=detect CPU) | -j 0 or -j 4 |
-l LOAD | Target system load average | -l 2.0 |
--clean | Clean build directory first | --clean |
-v, --verbose | Show full build commands | -v |
--ninja-args ARGS | Pass arguments to ninja | --ninja-args="-k 0" |
--vs-args ARGS | Pass arguments to msbuild | --vs-args="/p:Configuration=Release" |
--xcode-args ARGS | Pass arguments to xcodebuild | --xcode-args="-quiet" |
Targets can be specified by name or path:
# Build specific executable
meson compile -C build myexe
# Build specific library
meson compile -C build mylib
# Build with path (useful if names conflict)
meson compile -C build src/bin/myexe:executable
meson compile -C build src/lib/mylib:shared_library
# Build multiple targets
meson compile -C build myexe mylib
# Build all (default)
meson compile -C build#### Target Naming Convention
Meson target selectors are usually PATH/NAME.SUFFIX[:TYPE], where :TYPE is optional.
:executable — executable:shared_library — shared lib (.so, .dll, .dylib):static_library — static lib (.a, .lib):custom — custom target:run — run target (like "make run")Query available targets:
meson introspect build/ --targets| Option | Behavior |
|---|---|
-j 0 | Auto-detect CPU cores (recommended) |
-j 1 | Sequential (slow, useful for debugging) |
-j 4 | 4 parallel jobs |
-l 2.0 | Keep system load average ≤ 2.0 |
Default: Backend's default parallelism (ninja auto-detects, VS uses all cores by default).
# Fast build on modern machine
meson compile -C build -j 0
# Slow sequential build (good for debugging linker errors)
meson compile -C build -j 1
# Specific job count
meson compile -C build -j 4| Option | Shows |
|---|---|
| (default) | Summary: [X/Y] Compiling, [X/Y] Linking, etc. |
-v | Full compiler and linker commands |
--ninja-args="-d explain" | Why tasks are rebuilt (ninja only) |
--ninja-args="-d stats" | Build statistics (ninja only) |
--ninja-args="-k 0" | Keep going on first error, compile all (ninja only) |
Examples:
# See all compiler invocations
meson compile -C build -v
# Understand why things are rebuilding (ninja)
meson compile -C build --ninja-args="-d explain"
# Don't stop on first error (compile as much as possible)
meson compile -C build --ninja-args="-k 0"
# Show build statistics
meson compile -C build --ninja-args="-d stats"# Clean and rebuild (fastest clean-rebuild method)
meson compile -C build --clean
meson compile -C build
# Full wipe and reconfigure
rm -rf build && meson setup build && meson compile -C build# Fail fast, then show summary
meson compile -C build --ninja-args="-k 1"
# Keep going despite errors
meson compile -C build --ninja-args="-k 0"
# Show why rules are executing
meson compile -C build --ninja-args="-d explain"
# Build statistics
meson compile -C build --ninja-args="-d stats"
# Reduce parallelism dynamically
meson compile -C build -j 4 --ninja-args="-l 4.0"# Release configuration
meson compile -C build --vs-args="/p:Configuration=Release"
# Quiet output
meson compile -C build --vs-args="/v:quiet"
# Use 8 parallel jobs
meson compile -C build --vs-args="/m:8"# Quiet output
meson compile -C build --xcode-args="-quiet"
# Specific configuration
meson compile -C build --xcode-args="-configuration Release"# List all targets
meson introspect build/ --targets
# Grep for specific target
meson introspect build/ --targets | grep mylibExample output:
myexe (executable)
mylib (shared_library)
mylib_static (static_library)
run_tests (run)
iso_generator (custom)| Tip | Command | Benefit |
|---|---|---|
| Use all cores | -j 0 | Fastest builds |
| Load limiting | -l 4.0 | Don't overwhelm system |
| Incremental | (default) | Only rebuild changed deps |
| Verbose on error | -v when debugging | See actual compiler errors |
# Initial build (one-time, slow)
meson setup build
meson compile -C build -j 0
# Fast rebuilds after edits
meson compile -C build -j 0
# Rebuild one target only
meson compile -C build myexe
# Full rebuild if something's wrong
meson compile -C build --clean && meson compile -C build -j 0
# Debug a linker error
meson compile -C build -j 1 -vSee reference.md for exhaustive command reference.
See troubleshooting.md for build failure diagnosis. For systematic diagnosis spanning multiple areas, see the meson-debugging-troubleshooting skill.
Runnable examples live under this skill's examples/ directory.
-j as a substitute for fixing dependency bottlenecks-v as a performance tool instead of a debugging tool~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.