Build/Features/guess-platform-code.lua
2022-09-08 21:08:10 +01:00

102 lines
2.7 KiB
Lua

local function feature()
local function excludeFiles(name, noFiles, strict)
if (not noFiles) then
if (strict) then
excludes("**/*." .. name .. ".masm")
excludes("**/*." .. name .. ".*")
else
excludes("**/*" .. name .. ".masm")
excludes("**/*" .. name .. ".*")
end
end
excludes("**/" .. name .. "/**")
end
auFilter(auFilterOf({notPlatforms = {"win32"}, notArchs = {"x86_64"}}))
excludeFiles "win64"
auFilter{}
auFilter(auFilterOf({notPlatforms = {"win32"}}))
excludeFiles "windows"
excludeFiles "win32"
auFilter{}
auFilter(auFilterOf({notPlatforms = {"xbox"}}))
excludeFiles "xbox"
--if (not _G["uwp"]) then
excludeFiles "uwp"
auFilter{}
auFilter(auFilterOf({notPlatforms = {"win32", "xbox"}}))
excludeFiles("nt", false, true)
auFilter{}
auFilter(auFilterOf({notPlatforms = {"android"}}))
excludeFiles "android"
auFilter{}
local isNotApple = {"mac",
"ios"}
local isNotBsd = auConcatArrays({"bsd",
"ps4",
"ps5"}, isNotApple)
auFilter(auFilterOf({notPlatforms = isNotBsd}))
excludeFiles "bsd"
auFilter{}
auFilter(auFilterOf({notPlatforms = isNotApple}))
excludeFiles "apple"
excludeFiles "xnu"
excludeFiles "darwin"
auFilter{}
auFilter(auFilterOf({notPlatforms = {"mac"}}))
excludeFiles "osx"
excludeFiles "macos"
auFilter{}
local isNotLinux = {"linux",
"android"}
auFilter(auFilterOf({notPlatforms = auConcatArrays(isNotBsd, isNotLinux)}))
excludeFiles "unix"
auFilter{}
auFilter(auFilterOf({notPlatforms = {"linux", "android"}}))
excludeFiles "linux"
auFilter{}
auFilter(auFilterOf({notArchs = "x86_64"}))
excludeFiles "x64"
excludeFiles "x86_64"
excludeFiles "amd64"
auFilter{}
auFilter(auFilterOf({notArchs = "x86_32"}))
excludes "**/x86/**"
excludes "**/x86/**.c"
excludes "**/x86/**.h"
excludes "**/x86/**.*pp"
excludes "**/x86/**.masm"
excludes "**/x86/**.inl"
excludes "**/x86/**.cpp"
excludes "**/*.x86.*pp"
excludeFiles "x86_32"
excludeFiles "intel"
auFilter{}
auFilter(auFilterOf({notArchs = "arm"}))
excludeFiles ("arm", true)
excludeFiles "aarch64"
excludeFiles "aarch"
auFilter{}
excludeFiles "mips"
excludeFiles "mips64"
excludeFiles "amiga"
excludeFiles "powerpc"
excludeFiles "riscv"
end
return feature