summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2018-08-22 22:41:47 +0800
committerruki <[email protected]>2018-08-22 10:10:43 +0800
commit0681bad37f0b566b3f19072c46d8efdbf7987536 (patch)
tree0ee7199787e1554db10727f9c73e72d73e6eb91c
parentc9d05eaf022540940434ca60e4c800cc2b321e01 (diff)
add ignore projects
-rw-r--r--.gitignore1
-rw-r--r--tests/projects/other/merge_object/src/interface.c6
-rw-r--r--tests/projects/other/merge_object/src/interface.h8
-rw-r--r--tests/projects/other/merge_object/src/test.c8
-rw-r--r--tests/projects/other/merge_object/test.lua9
-rw-r--r--tests/projects/other/merge_object/xmake.lua45
-rw-r--r--tests/projects/other/merge_static_library/src/add.c4
-rw-r--r--tests/projects/other/merge_static_library/src/mul.c4
-rw-r--r--tests/projects/other/merge_static_library/src/sub.c4
-rw-r--r--tests/projects/other/merge_static_library/test.lua9
-rw-r--r--tests/projects/other/merge_static_library/xmake.lua58
-rwxr-xr-xtests/projects/other/requires/src/main.c7
-rw-r--r--tests/projects/other/requires/test.lua10
-rw-r--r--tests/projects/other/requires/xmake.lua32
14 files changed, 204 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 77458781a..abfbe8941 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,7 +29,6 @@
*.sys
cscope.*
gmon.out
-other
tags
doc
install.log
diff --git a/tests/projects/other/merge_object/src/interface.c b/tests/projects/other/merge_object/src/interface.c
new file mode 100644
index 000000000..598d07560
--- /dev/null
+++ b/tests/projects/other/merge_object/src/interface.c
@@ -0,0 +1,6 @@
+#include "interface.h"
+
+int add(int a, int b)
+{
+ return a + b;
+}
diff --git a/tests/projects/other/merge_object/src/interface.h b/tests/projects/other/merge_object/src/interface.h
new file mode 100644
index 000000000..10ec0f856
--- /dev/null
+++ b/tests/projects/other/merge_object/src/interface.h
@@ -0,0 +1,8 @@
+/*! calculate add(a, b)
+ *
+ * @param a the first argument
+ * @param b the second argument
+ *
+ * @return the result
+ */
+int add(int a, int b);
diff --git a/tests/projects/other/merge_object/src/test.c b/tests/projects/other/merge_object/src/test.c
new file mode 100644
index 000000000..9505a2f75
--- /dev/null
+++ b/tests/projects/other/merge_object/src/test.c
@@ -0,0 +1,8 @@
+#include "interface.h"
+#include <stdio.h>
+
+int main(int argc, char** argv)
+{
+ printf("add(1, 2) = %d\n", add(1, 2));
+ return 0;
+}
diff --git a/tests/projects/other/merge_object/test.lua b/tests/projects/other/merge_object/test.lua
new file mode 100644
index 000000000..84f48ef1c
--- /dev/null
+++ b/tests/projects/other/merge_object/test.lua
@@ -0,0 +1,9 @@
+-- imports
+import("...build")
+
+-- main entry
+function main()
+
+ -- build project
+ build()
+end
diff --git a/tests/projects/other/merge_object/xmake.lua b/tests/projects/other/merge_object/xmake.lua
new file mode 100644
index 000000000..b8f971536
--- /dev/null
+++ b/tests/projects/other/merge_object/xmake.lua
@@ -0,0 +1,45 @@
+-- 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("merge_object")
+
+ -- set kind
+ set_kind("static")
+
+ -- add files
+ add_files("src/interface.c")
+
+-- add target
+target("test")
+
+ -- set kind
+ set_kind("binary")
+
+ -- add deps
+ add_deps("merge_object")
+
+ -- add files
+ add_files("src/test.c")
+ add_files("build/.objs/merge_object/src/interface.c.o")
+
diff --git a/tests/projects/other/merge_static_library/src/add.c b/tests/projects/other/merge_static_library/src/add.c
new file mode 100644
index 000000000..be1e084fc
--- /dev/null
+++ b/tests/projects/other/merge_static_library/src/add.c
@@ -0,0 +1,4 @@
+int add(int a, int b)
+{
+ return a + b;
+}
diff --git a/tests/projects/other/merge_static_library/src/mul.c b/tests/projects/other/merge_static_library/src/mul.c
new file mode 100644
index 000000000..c4292f9aa
--- /dev/null
+++ b/tests/projects/other/merge_static_library/src/mul.c
@@ -0,0 +1,4 @@
+int mul(int a, int b)
+{
+ return a * b;
+}
diff --git a/tests/projects/other/merge_static_library/src/sub.c b/tests/projects/other/merge_static_library/src/sub.c
new file mode 100644
index 000000000..b151ec4bc
--- /dev/null
+++ b/tests/projects/other/merge_static_library/src/sub.c
@@ -0,0 +1,4 @@
+int sub(int a, int b)
+{
+ return a - b;
+}
diff --git a/tests/projects/other/merge_static_library/test.lua b/tests/projects/other/merge_static_library/test.lua
new file mode 100644
index 000000000..84f48ef1c
--- /dev/null
+++ b/tests/projects/other/merge_static_library/test.lua
@@ -0,0 +1,9 @@
+-- imports
+import("...build")
+
+-- main entry
+function main()
+
+ -- build project
+ build()
+end
diff --git a/tests/projects/other/merge_static_library/xmake.lua b/tests/projects/other/merge_static_library/xmake.lua
new file mode 100644
index 000000000..bd36a983a
--- /dev/null
+++ b/tests/projects/other/merge_static_library/xmake.lua
@@ -0,0 +1,58 @@
+-- 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("add")
+
+ -- set kind
+ set_kind("static")
+
+ -- add files
+ add_files("src/add.c")
+
+-- add target
+target("sub")
+
+ -- set kind
+ set_kind("static")
+
+ -- add files
+ add_files("src/sub.c")
+
+-- add target
+target("mul")
+
+ -- set kind
+ set_kind("static")
+
+ -- add deps
+ add_deps("add", "sub")
+
+ -- add files
+ add_files("src/mul.c")
+ add_files("build/libadd.a")
+ add_files("build/libsub.a")
+
+ -- add link directory
+ add_linkdirs("$(buildir)")
+
diff --git a/tests/projects/other/requires/src/main.c b/tests/projects/other/requires/src/main.c
new file mode 100755
index 000000000..9ae580511
--- /dev/null
+++ b/tests/projects/other/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/other/requires/test.lua b/tests/projects/other/requires/test.lua
new file mode 100644
index 000000000..2db93991f
--- /dev/null
+++ b/tests/projects/other/requires/test.lua
@@ -0,0 +1,10 @@
+-- imports
+import("...build")
+
+-- main entry
+function main()
+
+ -- TODO
+ -- build project
+-- build()
+end
diff --git a/tests/projects/other/requires/xmake.lua b/tests/projects/other/requires/xmake.lua
new file mode 100644
index 000000000..b34a691d1
--- /dev/null
+++ b/tests/projects/other/requires/xmake.lua
@@ -0,0 +1,32 @@
+-- define package
+package("mbedtls")
+ set_urls("https://github.com/ARMmbed/mbedtls.git")
+ add_deps("https://github.com/glennrp/libpng.git@libpng >=1.6.28")
+package_end()
+
+-- group packages
+package("zlib-mbedtls")
+ add_deps("zlib >=1.2.11", {system = false})
+ add_deps("mbedtls", {optional = true})
+package_end()
+
+-- requires
+add_requires("zlib-mbedtls")
+add_requires("[email protected] ~1.6.0", {alias = "tbox"})
+add_requires("unknown", {optional = true})
+
+-- add modes
+add_rules("mode.debug", "mode.release")
+
+-- add target
+target("console_c")
+
+ -- set kind
+ set_kind("binary")
+
+ -- add files
+ add_files("src/*.c")
+
+ -- add packages
+ add_packages("tbox", "zlib-mbedtls")
+