title: Xmake v3.0.6 Preview, Android Native Apps, Flang, AppImage/dmg Support tags: [xmake, android, flang, cuda, qt, packaging, msvc, binutils] date: 2025-12-17 author: Ruki
The new version further improves the build support for Android native applications. We can now configure more parameters in the android.native_app rule, including android_sdk_version, android_manifest, android_res, keystore, etc.
In addition, for scenarios that require custom entry and event loops (such as game engine integration), we support disabling the default android_native_app_glue library by setting native_app_glue = false.
add_rules("mode.debug", "mode.release")
add_requires("raylib 5.5.0")
target("raydemo_custom_glue")
set_kind("binary")
set_languages("c++17")
add_files("src/main.cpp", "src/android_native_app_glue.c")
add_syslinks("log")
add_packages("raylib")
add_rules("android.native_app", {
android_sdk_version = "35",
android_manifest = "android/AndroidManifest.xml",
android_res = "android/res",
keystore = "android/debug.jks",
keystore_pass = "123456",
package_name = "com.raylib.custom_glue",
native_app_glue = false, -- Disable default glue
logcat_filters = {"raydemo_custom_glue", "raylib"}
})
The newly added utils.bin2obj rule significantly improves build speed compared to utils.bin2c by directly generating object files (COFF, ELF, Mach-O) for linking, skipping the C code generation and compilation steps.
Performance Comparison (120MB file):
It supports multiple architectures (x86, ARM, RISC-V, etc.) and formats (COFF for Windows, ELF for Linux/Android, Mach-O for macOS/iOS).
Basic Usage
target("myapp")
set_kind("binary")
add_rules("utils.bin2obj", {extensions = {".bin", ".ico"}})
add_files("src/*.c")
-- Embed data.bin, ensure zero termination
add_files("assets/data.bin", {zeroend = true})
Accessing Data in C/C++
The symbol names are automatically generated based on the filename (e.g., _binary_<filename>_start and _binary_<filename>_end).
#include <stdio.h>
#include <stdint.h>
extern const uint8_t _binary_data_bin_start[];
extern const uint8_t _binary_data_bin_end[];
int main() {
// Calculate size
const uint32_t size = (uint32_t)(_binary_data_bin_end - _binary_data_bin_start);
// Access the data
printf("Data size: %u bytes\n", size);
for (uint32_t i = 0; i < size; i++) {
printf("%02x ", _binary_data_bin_start[i]);
}
return 0;
}
In addition, the glsl2spv and hlsl2spv rules also add support for bin2obj, which can directly embed compiled SPIR-V files as object files.
target("test")
set_kind("binary")
add_rules("utils.glsl2spv", {bin2obj = true})
add_files("src/*.c")
add_files("src/*.vert", "src/*.frag")
Xmake now supports the LLVM Flang compiler, making it more convenient to build Fortran projects. Usually, Xmake will automatically detect and use the available Flang compiler in the system.
You can also manually specify using the Flang toolchain:
$ xmake f --toolchain=flang
$ xmake
Or configure it in xmake.lua:
add_rules("mode.debug", "mode.release")
target("test")
set_kind("binary")
add_files("src/*.f90")
The XPack packaging module now supports generating Qt deployment packages, as well as AppImage (Linux) and dmg (macOS) formats. This makes distributing cross-platform GUI applications much simpler.
For example, configuring the packaging of a Qt Widget application:
includes("@builtin/xpack")
target("qtapp")
add_rules("qt.widgetapp")
add_files("src/*.cpp")
-- ... other configurations
xpack("qtapp")
set_formats("nsis", "dmg", "appimage", "zip")
set_title("Qt Widget App")
add_targets("qtapp")
-- Set icon file based on format
on_load(function (package)
local scriptdir = os.scriptdir()
if package:format() == "appimage" then
package:set("iconfile", path.join(scriptdir, "src/assets/xmake.png"))
else
package:set("iconfile", path.join(scriptdir, "src/assets/xmake.ico"))
end
end)
Execute the packaging command:
$ xmake pack
Added the xmake check syntax command for quickly checking syntax errors in project source code.
This is typically used in CI pipelines to rapidly verify code syntax without performing a full compilation and linking process, making it extremely fast.
Internally, xmake passes syntax checking flags like -fsyntax-only (GCC/Clang) or /Zs (MSVC) to the compiler.
This causes the compiler to perform only syntax analysis, skipping object file generation and linking, thereby significantly speeding up the check.
$ xmake check syntax
If there are syntax errors, it will report the specific file and line number.
We have added support for C++ dynamic debugging in MSVC (requires MSVC toolset 14.44+, x64 only).
It is incompatible with LTCG/PGO/OPT-ICF.
set_policy("build.c++.dynamic_debugging", true)
We added the core.base.binutils module and the utils.binary extension module for processing binary files.
They provide functions such as bin2c, bin2obj, readsyms, deplibs, and extractlib, which can be used to generate code from binary files, read symbols, obtain dependent libraries, and extract static libraries.
import("utils.binary.deplibs")
import("utils.binary.readsyms")
import("utils.binary.extractlib")
-- Get dependent libraries
local deps = deplibs("/path/to/bin")
-- Read symbols
local syms = readsyms("/path/to/obj")
-- Extract static library
extractlib("/path/to/lib.a", "/path/to/outputdir")
In addition, we have improved dependent library resolution, support for extracting objects used in static library merging, and symbol dumping.
/std:c++23preview support for MSVCbin2obj support for glsl/hlsl2spvbin2obj rule (faster than bin2c)xmake check syntax supportxrepo env to add session IDpackage.download.http_headersget_headerunit_key