diff options
| author | ruki <[email protected]> | 2024-04-03 22:53:00 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-04-03 22:53:00 +0800 |
| commit | db4196b069499e6fcf0d66c66a97665414c0011d (patch) | |
| tree | 8a564a22faf0bdabf81465c4e135692b98ba590a /xmake/templates/c/module.binary/project/modules/binary | |
| parent | d2b45f4d485d2778c5b08500365d6f0068c40b3b (diff) | |
add module.binary template
Diffstat (limited to 'xmake/templates/c/module.binary/project/modules/binary')
4 files changed, 37 insertions, 0 deletions
diff --git a/xmake/templates/c/module.binary/project/modules/binary/bar/.gitignore b/xmake/templates/c/module.binary/project/modules/binary/bar/.gitignore new file mode 100644 index 000000000..152105761 --- /dev/null +++ b/xmake/templates/c/module.binary/project/modules/binary/bar/.gitignore @@ -0,0 +1,8 @@ +# Xmake cache +.xmake/ +build/ + +# MacOS Cache +.DS_Store + + diff --git a/xmake/templates/c/module.binary/project/modules/binary/bar/src/add.c b/xmake/templates/c/module.binary/project/modules/binary/bar/src/add.c new file mode 100644 index 000000000..e19d07e12 --- /dev/null +++ b/xmake/templates/c/module.binary/project/modules/binary/bar/src/add.c @@ -0,0 +1,9 @@ +#include <stdio.h> +#include <stdlib.h> + +int main(int argc, char** argv) { + int a = atoi(argv[1]); + int b = atoi(argv[2]); + printf("%d", a + b); + return 0; +} diff --git a/xmake/templates/c/module.binary/project/modules/binary/bar/src/sub.c b/xmake/templates/c/module.binary/project/modules/binary/bar/src/sub.c new file mode 100644 index 000000000..980289d1a --- /dev/null +++ b/xmake/templates/c/module.binary/project/modules/binary/bar/src/sub.c @@ -0,0 +1,10 @@ +#include <stdio.h> +#include <stdlib.h> + +int main(int argc, char** argv) { + int a = atoi(argv[1]); + int b = atoi(argv[2]); + printf("%d", a - b); + return 0; +} + diff --git a/xmake/templates/c/module.binary/project/modules/binary/bar/xmake.lua b/xmake/templates/c/module.binary/project/modules/binary/bar/xmake.lua new file mode 100644 index 000000000..d4983d741 --- /dev/null +++ b/xmake/templates/c/module.binary/project/modules/binary/bar/xmake.lua @@ -0,0 +1,10 @@ +add_rules("mode.debug", "mode.release") + +target("add") + add_rules("module.binary") + add_files("src/add.c") + +target("sub") + add_rules("module.binary") + add_files("src/sub.c") + |
