diff options
| author | ruki <[email protected]> | 2021-08-05 00:29:18 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-08-05 00:29:18 +0800 |
| commit | b700ce5f896f1a3edfadafb4c188d1f147ea4ac7 (patch) | |
| tree | 298f5a01927bc8ce08eb5d0911f9f11d3f330d0d /tests/projects | |
| parent | 87d159290c9d9f5ad00e26640cb091f6ac068d05 (diff) | |
add bin2c module
Diffstat (limited to 'tests/projects')
| -rw-r--r-- | tests/projects/other/bin2c/.gitignore | 8 | ||||
| -rw-r--r-- | tests/projects/other/bin2c/src/data.bin | 1 | ||||
| -rw-r--r-- | tests/projects/other/bin2c/src/main.c | 11 | ||||
| -rw-r--r-- | tests/projects/other/bin2c/test.lua | 3 | ||||
| -rw-r--r-- | tests/projects/other/bin2c/xmake.lua | 9 |
5 files changed, 32 insertions, 0 deletions
diff --git a/tests/projects/other/bin2c/.gitignore b/tests/projects/other/bin2c/.gitignore new file mode 100644 index 000000000..152105761 --- /dev/null +++ b/tests/projects/other/bin2c/.gitignore @@ -0,0 +1,8 @@ +# Xmake cache +.xmake/ +build/ + +# MacOS Cache +.DS_Store + + diff --git a/tests/projects/other/bin2c/src/data.bin b/tests/projects/other/bin2c/src/data.bin new file mode 100644 index 000000000..c499e585b --- /dev/null +++ b/tests/projects/other/bin2c/src/data.bin @@ -0,0 +1 @@ +"hello xmake!" diff --git a/tests/projects/other/bin2c/src/main.c b/tests/projects/other/bin2c/src/main.c new file mode 100644 index 000000000..650531dcb --- /dev/null +++ b/tests/projects/other/bin2c/src/main.c @@ -0,0 +1,11 @@ +#include <stdio.h> + +static unsigned char g_bin_data[] = { + #include "data.bin.h" +}; + +int main(int argc, char** argv) +{ + printf("bin2c: %s\n", g_bin_data); + return 0; +} diff --git a/tests/projects/other/bin2c/test.lua b/tests/projects/other/bin2c/test.lua new file mode 100644 index 000000000..b57362078 --- /dev/null +++ b/tests/projects/other/bin2c/test.lua @@ -0,0 +1,3 @@ +function main(t) + t:build() +end diff --git a/tests/projects/other/bin2c/xmake.lua b/tests/projects/other/bin2c/xmake.lua new file mode 100644 index 000000000..4cd6f95ae --- /dev/null +++ b/tests/projects/other/bin2c/xmake.lua @@ -0,0 +1,9 @@ +add_rules("mode.debug", "mode.release") + +target("test") + set_kind("binary") + add_files("src/*.c") + add_files("src/*.bin") + add_rules("utils.bin2c") + + |
