Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve select_script #4973

Closed
star-hengxing opened this issue Apr 12, 2024 · 1 comment
Closed

Improve select_script #4973

star-hengxing opened this issue Apr 12, 2024 · 1 comment
Labels
Milestone

Comments

@star-hengxing
Copy link
Contributor

Xmake Version

dev

Operating System Version and Architecture

N/A

Describe Bug

xmake-io/xmake-repo#3750

Expected Behavior

Disable some plat and arm arch.

-- now
"windows|!arm*", "linux|!arm*", "macosx|!arm*", "bsd|!arm*", "mingw|!arm*", "msys|!arm*", "android|!arm*"
-- require
"*|!arm*", "!wasm", "!cross"
-- or
"!wasm,!cross|!arm*"

Project Configuration

N/A

Additional Information and Error Logs

N/A

@waruqi
Copy link
Member

waruqi commented Apr 17, 2024

现在可以支持逻辑表达了,支持 and or 和嵌套的表达式 a and b or (a and (c or d))

可以用 !wasm|!arm* and !cross|!arm* 来表述排除 wasm 和 cross 平台之外的 arm 架构

function test_logical_expr(t)
    t:require(_match_patterns("!macosx|x86_64,!iphoneos|arm64", {plat = "linux", arch = "x86_64"}))
    t:require(_match_patterns("!wasm|!arm* and !cross|!arm*", {plat = "linux", arch = "x86_64"}))
    t:require_not(_match_patterns("!wasm|!arm* and !cross|!arm*", {plat = "linux", arch = "arm64"}))
    t:require_not(_match_patterns("!wasm|!arm* and !cross|!arm*", {plat = "wasm", arch = "x86_64"}))
    t:require(_match_patterns("!macosx|x86_64 or !iphoneos|arm64", {plat = "linux", arch = "x86_64"}))
    t:require_not(_match_patterns("!android@macosx or !android@linux", {plat = "android", subhost = "macosx"}))
    t:require(_match_patterns("@macosx|x86_64 or @linux|x86_64", {subhost = "macosx", subarch = "x86_64"}))
    t:require(_match_patterns("@macosx or @linux", {subhost = "macosx"}))
    t:require(_match_patterns("!wasm|!arm* or (!cross|!arm* or linux)", {plat = "linux", arch = "arm64"}))
    t:require_not(_match_patterns("!wasm|!arm* or (!cross|!arm* and !linux)", {plat = "linux", arch = "arm64"}))
    t:require_not(_match_patterns("!macosx|x86_64 and !linux|x86_64", {plat = "linux", arch = "x86_64"}))
    t:require_not(_match_patterns("!macosx and !android", {plat = "android"}))
    t:require_not(_match_patterns("!macosx and !android", {plat = "macosx"}))
end

@waruqi waruqi added this to the v2.9.1 milestone Apr 17, 2024
@waruqi waruqi closed this as completed Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants