diff --git a/Core/Target/Target.lua b/Core/Target/Target.lua index eaecfbe..cb008a3 100644 --- a/Core/Target/Target.lua +++ b/Core/Target/Target.lua @@ -140,7 +140,7 @@ local function auFilterOf(configFilter, ...) return end - if (not test(platform, configFilter.platforms, configFilter.notPlatform)) then + if (not test(platform, configFilter.platforms, configFilter.notPlatforms)) then return end diff --git a/Features/guess-platform-code.lua b/Features/guess-platform-code.lua index 3cb5984..8ae32c3 100644 --- a/Features/guess-platform-code.lua +++ b/Features/guess-platform-code.lua @@ -1,5 +1,5 @@ + local feature = function() - local excludeFiles = function(name, noFiles) if (not noFiles) then excludes("**/*" .. name .. ".masm") @@ -8,76 +8,59 @@ local feature = function() excludes("**/" .. name .. "/**") end - if (not _G["win32"]) then - if (not _G["x86_64"]) then - excludeFiles "win64" - end - excludeFiles "win32" - end + filter(auFilterOf({notPlatforms = {"win32"}, notArchs = {"win64"}})) + excludeFiles "win64" - if (not _G["win32"]) then + filter(auFilterOf({notPlatforms = {"win32"}})) excludeFiles "windows" - end + excludeFiles "win32" - if (not _G["xbox"]) then + filter(auFilterOf({notPlatforms = {"xbox"}})) excludeFiles "xbox" - end - if (not _G["uwp"]) then - excludeFiles "uwp" - end + --if (not _G["uwp"]) then + excludeFiles "uwp" - if (not _G["win32"] and not _G["xbox"]) then + filter(auFilterOf({notPlatforms = {"win32", "xbox"}})) excludeFiles "nt" - end - if (not _G["android"]) then + filter(auFilterOf({notPlatforms = {"android"}})) excludeFiles "android" - end - if (_G["mac"]) then - excludeFiles "macos" - end + local isNotApple = {"mac", + "ios"} - local isNotApple = not _G["mac"] - and not _G["ios"] - - local isNotBsd = not _G["bsd"] - and not _G["ps4"] - and not _G["ps5"] - and isNotApple + local isNotBsd = auConcatArrays({"bsd", + "ps4", + "ps5"}, isNotApple) - if (not isNotBsd) then + filter(auFilterOf({notPlatforms = isNotBsd})) excludeFiles "bsd" - end - if (isNotApple) then + filter(auFilterOf({notPlatforms = isNotApple})) excludeFiles "apple" excludeFiles "xnu" - end - if (not _G["mac"]) then + filter(auFilterOf({notPlatforms = {"mac"}})) excludeFiles "osx" - end + excludeFiles "macos" - local isNotLinux = not _G["linux"] - and not _G["android"] + local isNotLinux = {"linux", + "android"} - if (isNotBsd and isNotLinux) then + filter(auFilterOf({notPlatforms = auConcatArrays(isNotBsd, isNotLinux)})) excludeFiles "unix" - end - if (isNotLinux) then + filter(auFilterOf({notPlatforms = {"linux", "android"}})) excludeFiles "linux" - end - if (not _G["x86_64"]) then + filter(auFilterOf({notArchs = "x86_64"})) + excludeFiles "x64" excludeFiles "x86_64" excludeFiles "amd64" - end - if (not _G["x86_32"]) then + filter(auFilterOf({notArchs = "x86_32"})) excludes "**/x86/**" excludes "**/x86/**.c" excludes "**/x86/**.h" @@ -88,13 +71,13 @@ local feature = function() excludes "**/*.x86.*pp" excludeFiles "x86_32" excludeFiles "intel" - end - if (not _G["arm"]) then + filter(auFilterOf({notArchs = "arm"})) excludeFiles ("arm", true) excludeFiles "aarch64" excludeFiles "aarch" - end + + filter{} excludeFiles "mips" excludeFiles "mips64"