summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorruki <[email protected]>2021-09-29 22:47:38 +0800
committerruki <[email protected]>2021-09-29 22:47:38 +0800
commit913fcb7fbe40b009eb6759dd00b37ece56ef72a8 (patch)
treed9997a6907cf162e47368b0f501938054c7aa731 /tests
parent9b11147b98d5b51bc5064757c7f3629e5ad37cbb (diff)
support to build embed package with cmake
Diffstat (limited to 'tests')
-rw-r--r--tests/projects/c/library_with_cmakelists/test.lua6
-rw-r--r--tests/projects/c/library_with_cmakelists/xmake.lua6
2 files changed, 9 insertions, 3 deletions
diff --git a/tests/projects/c/library_with_cmakelists/test.lua b/tests/projects/c/library_with_cmakelists/test.lua
new file mode 100644
index 000000000..b76241be2
--- /dev/null
+++ b/tests/projects/c/library_with_cmakelists/test.lua
@@ -0,0 +1,6 @@
+-- main entry
+function main(t)
+
+ -- build project
+ t:build()
+end
diff --git a/tests/projects/c/library_with_cmakelists/xmake.lua b/tests/projects/c/library_with_cmakelists/xmake.lua
index 4bf632e08..e5646c372 100644
--- a/tests/projects/c/library_with_cmakelists/xmake.lua
+++ b/tests/projects/c/library_with_cmakelists/xmake.lua
@@ -2,15 +2,15 @@ add_rules("mode.debug", "mode.release")
package("foo")
add_deps("cmake")
- set_sourcedir("foo")
+ set_sourcedir(path.join(os.scriptdir(), "foo"))
on_install(function (package)
local configs = {}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
- import("package.tools.cmake").install(package, configs, {buildir = "build"})
+ import("package.tools.cmake").install(package, configs)
end)
on_test(function (package)
- assert(package:has_cincludes("foo.h"))
+ assert(package:has_cfuncs("add", {includes = "foo.h"}))
end)
package_end()