xmake-feature-check
Installation
SKILL.md
Feature & Capability Checks
Xmake can probe the target toolchain at configure time for:
- Does a compiler flag work? (
check_cflags,check_cxxflags) - Does a C/C++ function exist? (
has_cfuncs,has_cxxfuncs) - Does a type exist? (
has_ctypes,has_cxxtypes) - Does an include exist? (
has_cincludes,has_cxxincludes) - Does an arbitrary snippet compile? (
check_csnippets,check_cxxsnippets) - Does a C++ feature work? (
has_features("cxx_constexpr"), …) - Is a tool/program on
PATH? (find_tool,find_program) - Is a library findable? (
find_package)
Use these to branch configuration on capability instead of hard-coding if is_plat(...).
In an option (the declarative form)
Options have a short-hand for capability probes — if the probe succeeds, the option is automatically enabled.