diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/projects/c/library_with_cmakelists/test.lua | 6 | ||||
| -rw-r--r-- | tests/projects/c/library_with_cmakelists/xmake.lua | 6 |
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() |
