summaryrefslogtreecommitdiff
path: root/tests/projects/linux/driver/hello_cross/xmake.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/projects/linux/driver/hello_cross/xmake.lua')
-rw-r--r--tests/projects/linux/driver/hello_cross/xmake.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/projects/linux/driver/hello_cross/xmake.lua b/tests/projects/linux/driver/hello_cross/xmake.lua
new file mode 100644
index 000000000..c5372de0b
--- /dev/null
+++ b/tests/projects/linux/driver/hello_cross/xmake.lua
@@ -0,0 +1,21 @@
+set_plat("linux")
+
+option("linux-headers", {showmenu = true, description = "Set kernel headers/source tree path."})
+option("linux-builddir", {showmenu = true, description = "Set kernel build/output tree path."})
+
+-- Example:
+-- xmake f -p linux -a arm64 --cc=/path/to/aarch64-linux-gnu-gcc \
+-- --ld=/path/to/aarch64-linux-gnu-ld \
+-- --linux-headers=/path/to/linux \
+-- --linux-builddir=/path/to/linux-out
+
+target("hello")
+ add_rules("platform.linux.module")
+ add_files("src/*.c")
+ set_license("GPL-2.0")
+ if has_config("linux-headers") then
+ set_values("linux.driver.linux-headers", get_config("linux-headers"))
+ end
+ if has_config("linux-builddir") then
+ set_values("linux.driver.linux-builddir", get_config("linux-builddir"))
+ end