summaryrefslogtreecommitdiff
path: root/tests/projects
diff options
context:
space:
mode:
authorruki <[email protected]>2017-08-14 11:27:19 +0800
committerruki <[email protected]>2017-08-14 11:29:30 +0800
commitdba45d143d8aff047da82cbe1a881056e6e4bc00 (patch)
tree7b80d5de264c17b538a7c9d0fbb234ded39ac683 /tests/projects
parent34706ba053dda9dd86902cacf42a6c1878c85234 (diff)
merge repo and require codes
Diffstat (limited to 'tests/projects')
-rwxr-xr-xtests/projects/requires/src/main.c7
-rw-r--r--tests/projects/requires/test.lua10
-rw-r--r--tests/projects/requires/xmake.lua48
3 files changed, 65 insertions, 0 deletions
diff --git a/tests/projects/requires/src/main.c b/tests/projects/requires/src/main.c
new file mode 100755
index 000000000..9ae580511
--- /dev/null
+++ b/tests/projects/requires/src/main.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+int main(int argc, char** argv)
+{
+ printf("hello world!\n");
+ return 0;
+}
diff --git a/tests/projects/requires/test.lua b/tests/projects/requires/test.lua
new file mode 100644
index 000000000..eacf35408
--- /dev/null
+++ b/tests/projects/requires/test.lua
@@ -0,0 +1,10 @@
+-- imports
+import("..build")
+
+-- main entry
+function main()
+
+ -- TODO
+ -- build project
+-- build()
+end
diff --git a/tests/projects/requires/xmake.lua b/tests/projects/requires/xmake.lua
new file mode 100644
index 000000000..f96866d10
--- /dev/null
+++ b/tests/projects/requires/xmake.lua
@@ -0,0 +1,48 @@
+-- define package
+package("mbedtls")
+ set_urls("https://github.com/ARMmbed/mbedtls.git")
+ add_requires("https://github.com/glennrp/libpng.git@libpng >=1.6.28")
+package_end()
+
+-- group packages
+package("zlib-mbedtls")
+ add_requires("zlib >=1.2.11")
+ add_requires("mbedtls master optional")
+package_end()
+
+-- requires
+add_requires("zlib-mbedtls")
+add_requires("[email protected] >=1.5.1 <1.6.1 optional")
+
+-- the debug mode
+if is_mode("debug") then
+
+ -- enable the debug symbols
+ set_symbols("debug")
+
+ -- disable optimization
+ set_optimize("none")
+end
+
+-- the release mode
+if is_mode("release") then
+
+ -- set the symbols visibility: hidden
+ set_symbols("hidden")
+
+ -- enable fastest optimization
+ set_optimize("fastest")
+
+ -- strip all symbols
+ set_strip("all")
+end
+
+-- add target
+target("console_c")
+
+ -- set kind
+ set_kind("binary")
+
+ -- add files
+ add_files("src/*.c")
+