summaryrefslogtreecommitdiff
path: root/tests/projects/c/headeronly
diff options
context:
space:
mode:
authorruki <[email protected]>2021-10-16 23:18:53 +0800
committerruki <[email protected]>2021-10-16 23:18:53 +0800
commit194e8abb709553c79d5ee34d9bd4a714aa3004d7 (patch)
tree919729e21b2c434e63d3d8d671fdc83adebf53b5 /tests/projects/c/headeronly
parentbbe1a5c2f7418d085304d1dcd0462cf4b2193497 (diff)
add headeronly kind for target
Diffstat (limited to 'tests/projects/c/headeronly')
-rw-r--r--tests/projects/c/headeronly/src/foo.h9
-rw-r--r--tests/projects/c/headeronly/test.lua6
-rw-r--r--tests/projects/c/headeronly/xmake.lua9
3 files changed, 24 insertions, 0 deletions
diff --git a/tests/projects/c/headeronly/src/foo.h b/tests/projects/c/headeronly/src/foo.h
new file mode 100644
index 000000000..915f44b87
--- /dev/null
+++ b/tests/projects/c/headeronly/src/foo.h
@@ -0,0 +1,9 @@
+/*! 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/c/headeronly/test.lua b/tests/projects/c/headeronly/test.lua
new file mode 100644
index 000000000..b76241be2
--- /dev/null
+++ b/tests/projects/c/headeronly/test.lua
@@ -0,0 +1,6 @@
+-- main entry
+function main(t)
+
+ -- build project
+ t:build()
+end
diff --git a/tests/projects/c/headeronly/xmake.lua b/tests/projects/c/headeronly/xmake.lua
new file mode 100644
index 000000000..d43bdceda
--- /dev/null
+++ b/tests/projects/c/headeronly/xmake.lua
@@ -0,0 +1,9 @@
+add_rules("mode.release", "mode.debug")
+
+target("foo")
+ set_kind("headeronly")
+ add_headerfiles("src/foo.h")
+ add_rules("utils.install.cmake_importfiles")
+ add_rules("utils.install.pkgconfig_importfiles")
+
+