summaryrefslogtreecommitdiff
path: root/tests/projects
diff options
context:
space:
mode:
authorruki <[email protected]>2019-09-04 00:34:37 +0800
committerruki <[email protected]>2019-09-03 21:27:46 +0800
commitd6b8d3ac7c4174ac8285e8ff5a4798f211f82d44 (patch)
tree348d4a091017d61d40b9117ab2ba692eaf47433a /tests/projects
parentca20eae2af926af38bd19a539bd919f4cd1439cd (diff)
improve hybrid test
Diffstat (limited to 'tests/projects')
-rw-r--r--tests/projects/hybrid/static_library/src/main2.cpp7
-rw-r--r--tests/projects/hybrid/static_library/src/test.h1
-rw-r--r--tests/projects/hybrid/static_library/src/test5.d5
-rw-r--r--tests/projects/hybrid/static_library/xmake.lua6
4 files changed, 18 insertions, 1 deletions
diff --git a/tests/projects/hybrid/static_library/src/main2.cpp b/tests/projects/hybrid/static_library/src/main2.cpp
new file mode 100644
index 000000000..73890bc01
--- /dev/null
+++ b/tests/projects/hybrid/static_library/src/main2.cpp
@@ -0,0 +1,7 @@
+#include "test.h"
+
+int main(int argc, char** argv)
+{
+ test5();
+ return 0;
+}
diff --git a/tests/projects/hybrid/static_library/src/test.h b/tests/projects/hybrid/static_library/src/test.h
index 3d4687d06..f794a69c7 100644
--- a/tests/projects/hybrid/static_library/src/test.h
+++ b/tests/projects/hybrid/static_library/src/test.h
@@ -6,6 +6,7 @@ void test1(void);
void test2(void);
void test3(void);
void test4(void);
+int test5(void);
#ifdef __cplusplus
}
diff --git a/tests/projects/hybrid/static_library/src/test5.d b/tests/projects/hybrid/static_library/src/test5.d
new file mode 100644
index 000000000..d6519665d
--- /dev/null
+++ b/tests/projects/hybrid/static_library/src/test5.d
@@ -0,0 +1,5 @@
+
+extern(C) int test5()
+{
+ return 5;
+}
diff --git a/tests/projects/hybrid/static_library/xmake.lua b/tests/projects/hybrid/static_library/xmake.lua
index c0222501c..52e23e98b 100644
--- a/tests/projects/hybrid/static_library/xmake.lua
+++ b/tests/projects/hybrid/static_library/xmake.lua
@@ -8,6 +8,10 @@ target("test")
target("demo")
set_kind("binary")
add_deps("test")
- add_files("src/*.cpp")
+ add_files("src/main.cpp")
+
+target("demo2")
+ set_kind("binary")
+ add_files("src/main2.cpp", "src/*.d")