xmake-policy

Installation
SKILL.md

set_policy — Feature Toggles

Policies are named feature toggles xmake exposes via set_policy("<name>", <value>). They replace ad-hoc flags with a stable, versioned API — enabling a feature like "C++20 modules" or "address sanitizer" is a single call that works across compilers.

Policies live in xmake.lua and can be set at project or target scope.

1. Basic usage

-- project-wide
set_policy("build.warning", true)

target("app")
    -- per-target
    set_policy("build.optimization.lto", true)
    set_policy("build.sanitizer.address", true)
Installs
4
GitHub Stars
16
First Seen
Apr 29, 2026
xmake-policy — xmake-io/xmake-skills