diff options
| author | ruki <[email protected]> | 2021-02-09 23:43:27 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-02-09 23:43:27 +0800 |
| commit | bc620153c3b7b7de9f62612339788ff98689a403 (patch) | |
| tree | fc4a9c70d94589f217539917db648021a007b00f /tests/projects | |
| parent | b4420e51c372cd46367852a354855555b044b21c (diff) | |
pass toolchains to package
Diffstat (limited to 'tests/projects')
| -rw-r--r-- | tests/projects/package/toolchain_muslcc/src/main.c | 2 | ||||
| -rw-r--r-- | tests/projects/package/toolchain_muslcc/test.lua | 12 | ||||
| -rw-r--r-- | tests/projects/package/toolchain_muslcc/xmake.lua | 17 |
3 files changed, 22 insertions, 9 deletions
diff --git a/tests/projects/package/toolchain_muslcc/src/main.c b/tests/projects/package/toolchain_muslcc/src/main.c index 9ec3e9c6d..c8b1209a0 100644 --- a/tests/projects/package/toolchain_muslcc/src/main.c +++ b/tests/projects/package/toolchain_muslcc/src/main.c @@ -1,11 +1,9 @@ #include <stdio.h> #include <zlib.h> -#include <pcre2.h> int main(int argc, char** argv) { printf("hello world!\n"); inflate(0, 0); - pcre2_compile(0, 0, 0, 0, 0, 0); return 0; } diff --git a/tests/projects/package/toolchain_muslcc/test.lua b/tests/projects/package/toolchain_muslcc/test.lua new file mode 100644 index 000000000..4964fecaa --- /dev/null +++ b/tests/projects/package/toolchain_muslcc/test.lua @@ -0,0 +1,12 @@ +function main(t) + + -- freebsd ci is slower + if is_host("bsd") then + return + end + + -- only for x86/x64, because it will take too long time on ci with arm/mips + if os.subarch():startswith("x") or os.subarch() == "i386" then + t:build() + end +end diff --git a/tests/projects/package/toolchain_muslcc/xmake.lua b/tests/projects/package/toolchain_muslcc/xmake.lua index 688cb241c..bd0b1245c 100644 --- a/tests/projects/package/toolchain_muslcc/xmake.lua +++ b/tests/projects/package/toolchain_muslcc/xmake.lua @@ -1,16 +1,19 @@ add_rules("mode.debug", "mode.release") --- set muslcc as global toolchain +-- set cross-compliation platform +set_plat("cross") +set_arch("arm") + +-- add toolchains package add_requires("muslcc") -set_toolchains("@muslcc") --- explicitly specify the package toolchain -add_requires("zlib", {configs = {toolchains = "@muslcc"}}) +-- add library packages +add_requires("zlib", {system = false}) --- use global toolchain: muslcc -add_requires("pcre2") +-- set global toolchains for target and packages +set_toolchains("@muslcc") target("test") set_kind("binary") add_files("src/*.c") - add_packages("zlib", "pcre2") + add_packages("zlib", "openssl") |
