Skip to content

Specification

Naming conventions

The interface is named according to some of the predefined specifications, which is more convenient to understand and easy to use.

It's according to the following rules:

InterfacesDescription
is_/has_ + xxxCondition interfaces
set_ + xxxSet and override the previous settings
add_ + xxxSet and append settings
…s + xxx (plural)Support multi-parameters, .e.g:add_files("*.c", "test.cpp")
on_ + xxxSet and override builtin script
before_ + xxxSet and run this script before running builtin-script
after_ + xxxSet and run this script after running builtin-script
scope("name")Define a description scope, .e.g target("xxx"), option("xxx")
scope/settingsIndentation with spaces

If you are new to xmake, it is recommended to read the Project Configuration Syntax Guide first to understand the basic structure of xmake.lua. The naming conventions below apply to all Description Domain APIs.