Xmake package¶
Added in version 3.1.
An Xmake package provides support for processing an Xmake supported module.
LIBFOO_TYPE = 'xmake'
During the configuration stage of an Xmake package, xmake config will be
invoked to generate build files for the module. For the build stage,
xmake build will invoke the generated build files. For the installation
stage (if enabled), xmake install will be used. Each stage can be
configured to manipulate environment variables and options used by Xmake.
The default configuration applies no explicit mode. A developer can set this
option to a supported mode of the project by explicitly adjusting the
configuration option LIBFOO_XMAKE_BUILD_TYPE to, for example, debug:
LIBFOO_XMAKE_BUILD_TYPE = 'debug'
The following shows the default arguments used in stages and outlines
configuration options that are available for an Xmake package to set.
See also the Xmake package examples. All stages
are invoked with a PKG_BUILD_DIR working directory.
The configuration stage invokes xmake with the arguments:
xmake config \
--includedirs=<SYSROOT_INCLUDE_PATHS> \
--linkdirs=<SYSROOT_LIBRARY_PATHS> \
--mode=<MODE> \
-o <BUILD_OUTPUT_DIR>
With the following environment variables set:
XMAKE_CONFIGDIR=<BUILD_OUTPUT_DIR>
XMAKE_GLOBALDIR=<BUILD_BASE_DIR>/.releng-tool-xmake-global
The mode/build type can configured by
LIBFOO_XMAKE_BUILD_TYPE. If no mode is
configured, the --mode argument will not be used.
The build output directory is configured to
PKG_BUILD_OUTPUT_DIR.
Paths may vary based on how the package’s
LIBFOO_INSTALL_TYPE is configured. For example,
system include/library paths provided will only include the staging directory
if staging is configured. Likewise, both the staging and target directories
are provided when using staging_and_target.
The build stage invokes xmake with the arguments:
xmake build --jobs <NJOBS>
With the following environment variables set:
XMAKE_CONFIGDIR=<BUILD_OUTPUT_DIR>
XMAKE_GLOBALDIR=<BUILD_BASE_DIR>/.releng-tool-xmake-global
The number of jobs is populated by either the --jobs argument,
LIBFOO_FIXED_JOBS or
LIBFOO_MAX_JOBS. Although, if the configuration results
in a single job, the argument will not be used.
The install stage invokes xmake with the arguments:
xmake install --installdir <TARGET_DIR>
With the following environment variables set:
XMAKE_CONFIGDIR=<BUILD_OUTPUT_DIR>
XMAKE_GLOBALDIR=<BUILD_BASE_DIR>/.releng-tool-xmake-global
The --installdir argument will be set to the target sysroot the package
should install into (see also LIBFOO_INSTALL_TYPE).
xmake install may be invoked multiple times for each target it needs to
install into.
The installation stage can be skipped by configuring
LIBFOO_XMAKE_NOINSTALL.
LIBFOO_BUILD_DEFS¶
Geändert in Version 2.2: Support added for path-like values.
Provides a means to pass definitions into the build process. This option can is defined as a dictionary of string pairs. This field is optional.
LIBFOO_BUILD_DEFS = {
# adds "--option=value" to the command
'--option': 'value',
}
LIBFOO_BUILD_ENV¶
Geändert in Version 2.2: Support added for path-like values.
Provides a means to pass environment variables into the build process. This option is defined as a dictionary with key-value pairs where the key is the environment name and the value is the environment variable’s value. This field is optional.
LIBFOO_BUILD_ENV = {
'OPTION': 'VALUE',
}
LIBFOO_BUILD_OPTS¶
Geändert in Version 2.2: Support added for path-like values.
Provides a means to pass command line options into the build process. This option can be defined as a dictionary of string pairs or a list with strings – either way defined will generate argument values to include in the build event. This field is optional.
LIBFOO_BUILD_OPTS = {
# adds "--option value" to the command
'--option': 'value',
# adds "--flag" to the command
'--flag': '',
}
# (or)
LIBFOO_BUILD_OPTS = [
# adds "--some-option" to the command
'--some-option',
]
LIBFOO_CONF_DEFS¶
Geändert in Version 2.2: Support added for path-like values.
Provides a means to pass definitions into the configuration process. This option can is defined as a dictionary of string pairs. This field is optional.
LIBFOO_CONF_DEFS = {
# adds "--option=value" to the command
'--option': 'value',
}
LIBFOO_CONF_ENV¶
Geändert in Version 2.2: Support added for path-like values.
Provides a means to pass environment variables into the configuration process. This option is defined as a dictionary with key-value pairs where the key is the environment name and the value is the environment variable’s value. This field is optional.
LIBFOO_CONF_ENV = {
'OPTION': 'VALUE',
}
LIBFOO_CONF_OPTS¶
Geändert in Version 2.2: Support added for path-like values.
Provides a means to pass command line options into the configuration process. This option can be defined as a dictionary of string pairs or a list with strings – either way defined will generate argument values to include in the configuration event. This field is optional.
LIBFOO_CONF_OPTS = {
# adds "--option value" to the command
'--option': 'value',
# adds "--flag" to the command
'--flag': '',
}
# (or)
LIBFOO_CONF_OPTS = [
# adds "--some-option" to the command
'--some-option',
]
LIBFOO_ENV¶
Added in version 0.17.
Geändert in Version 2.2: Support added for path-like values.
Provides a means to pass environment variables into all stages for a package. This option is defined as a dictionary with key-value pairs where the key is the environment name and the value is the environment variable’s value. This field is optional.
LIBFOO_ENV = {
'OPTION': 'VALUE',
}
See also environment.
LIBFOO_INSTALL_DEFS¶
Geändert in Version 2.2: Support added for path-like values.
Provides a means to pass definitions into the installation process. This option can is defined as a dictionary of string pairs. This field is optional.
LIBFOO_INSTALL_DEFS = {
# adds "--option=value" to the command
'--option': 'value',
}
LIBFOO_INSTALL_ENV¶
Geändert in Version 2.2: Support added for path-like values.
Provides a means to pass environment variables into the installation process. This option is defined as a dictionary with key-value pairs where the key is the environment name and the value is the environment variable’s value. This field is optional.
LIBFOO_INSTALL_ENV = {
'OPTION': 'VALUE',
}
LIBFOO_INSTALL_OPTS¶
Geändert in Version 2.2: Support added for path-like values.
Provides a means to pass command line options into the installation process. This option can be defined as a dictionary of string pairs or a list with strings – either way defined will generate argument values to include in the installation event. This field is optional.
LIBFOO_INSTALL_OPTS = {
# adds "--option value" to the command
'--option': 'value',
# adds "--flag" to the command
'--flag': '',
}
# (or)
LIBFOO_INSTALL_OPTS = [
# adds "--some-option" to the command
'--some-option',
]
LIBFOO_XMAKE_BUILD_TYPE¶
Specifies the mode to use for the Xmake package. Modes
for an individual package may vary as a project file (xmake.lua) defines
modes it supports (although commonly named modes include debug, release,
releasedbg and minsizerel). A developer needing to use a specific mode
can configure this option with the name of the mode. By default, no explicit
mode is used for all Xmake packages.
LIBFOO_XMAKE_BUILD_TYPE = 'releasedbg'
See also default_xmake_build_type.
LIBFOO_XMAKE_NOINSTALL¶
Specifies whether the Xmake package should skip an attempt to invoke the
install command. Ideally, projects will have an install
options configured to define how a project will install files into a target
(or staging) environment. Not all Xmake projects have installation options
configured, or there can be cases where installation stage for a package to
fail due to issues with some host environments. A developer can specify this
no-install flag to skip an Xmake-driven install request and manage installation
actions through other means (such as post-processing). By default, the
installation stage is invoked with a value of False.
LIBFOO_XMAKE_NOINSTALL = True