Skip to content

Commit

Permalink
add check
Browse files Browse the repository at this point in the history
  • Loading branch information
star-hengxing committed Sep 18, 2024
1 parent a08daeb commit e760b59
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/f/flux/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,25 @@ package("flux")

add_deps("cmake")

if on_check then
on_check("android", function (package)
local ndk = package:toolchain("ndk")
local ndkver = ndk:config("ndkver")
local ndk_sdkver = ndk:config("ndk_sdkver")
assert(ndkver and tonumber(ndkver) > 22, "package(flux) require ndk version > 22")
assert(ndk_sdkver and tonumber(ndk_sdkver) >= 24, "package(flux) require ndk api >= 24")
end)

on_check("windows", function (package)
local vs_toolset = package:toolchain("msvc"):config("vs_toolset")
if vs_toolset then
local vs_toolset_ver = import("core.base.semver").new(vs_toolset)
local minor = vs_toolset_ver:minor()
assert(minor and minor >= 30, "package(flux) require vs_toolset >= 14.3")
end
end)
end

on_install(function (package)
local configs = {"-DFLUX_BUILD_EXAMPLES=OFF", "-DFLUX_BUILD_TESTS=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
Expand Down

0 comments on commit e760b59

Please sign in to comment.