Clean up clang options now that clang 5 is a hard requirement, and suppress xor-used-as-pow warning introduced in clang 10

This commit is contained in:
Vas Crabb 2020-08-18 01:00:47 +10:00
parent c2ea83fc91
commit c8218dabdb

View File

@ -1062,8 +1062,8 @@ end
local version = str_to_version(_OPTIONS["gcc_version"])
if string.find(_OPTIONS["gcc"], "clang") or string.find(_OPTIONS["gcc"], "pnacl") or string.find(_OPTIONS["gcc"], "asmjs") or string.find(_OPTIONS["gcc"], "android") then
if (version < 30400) then
print("Clang version 3.4 or later needed")
if (version < 50000) then
print("Clang version 5.0 or later needed")
os.exit(-1)
end
buildoptions {
@ -1072,28 +1072,24 @@ end
"-Wno-unused-value",
"-Wno-constant-logical-operand",
"-fdiagnostics-show-note-include-stack",
"-Wno-unknown-warning-option",
"-Wno-extern-c-compat",
"-Wno-unknown-attributes",
"-Wno-ignored-qualifiers"
}
if (version >= 30500) then
buildoptions {
"-Wno-unknown-warning-option",
"-Wno-extern-c-compat",
"-Wno-unknown-attributes",
"-Wno-ignored-qualifiers"
}
end
if (version >= 60000) then
buildoptions {
"-Wno-pragma-pack" -- clang 6.0 complains when the packing change lifetime is not contained within a header file.
}
end
if ((version < 60000) or (_OPTIONS["targetos"]=="macosx" and (version <= 90000))) then
if (version >= 100000) and (_OPTIONS["targetos"] ~= 'macosx') then -- TODO when Xcode includes clang 10, update this to detect the vanity version number
buildoptions {
"-Wno-missing-braces" -- std::array brace initialization not fixed until 6.0.0 (https://reviews.llvm.org/rC314838)
"-Wno-xor-used-as-pow " -- clang 10.0 complains that expressions like 10 ^ 7 look like exponention
}
end
if (_OPTIONS["targetos"]=="macosx" and (version < 80000)) then
defines {
"TARGET_OS_OSX=1",
if (version < 60000) or ((_OPTIONS["targetos"] == "macosx") and (version <= 90000)) then
buildoptions {
"-Wno-missing-braces" -- std::array brace initialization not fixed until 6.0.0 (https://reviews.llvm.org/rC314838)
}
end
else