summaryrefslogtreecommitdiffstatshomepage
path: root/scripts
diff options
context:
space:
mode:
author Patrick Mackinlay <pmackinlay@hotmail.com>2025-05-13 11:38:55 +0700
committer GitHub <noreply@github.com>2025-05-13 11:38:55 +0700
commitda468a4f50d1f06837e1bce38b12475f4693471d (patch)
tree1fcf8041e8e74dfcdd40f46bc0784501f606937a /scripts
parent825d94ef0125b487cd61cc507abcfef700971ead (diff)
build: update vs/msbuild settings to reflect current clangcl (#13633)
Diffstat (limited to 'scripts')
-rw-r--r--scripts/genie.lua67
-rwxr-xr-xscripts/src/3rdparty.lua96
2 files changed, 103 insertions, 60 deletions
diff --git a/scripts/genie.lua b/scripts/genie.lua
index 819b753e794..a276c345bc8 100644
--- a/scripts/genie.lua
+++ b/scripts/genie.lua
@@ -473,16 +473,6 @@ flags {
"Cpp17",
}
-configuration { "vs20*" }
- buildoptions {
- "/bigobj",
- }
- buildoptions_cpp {
- "/Zc:__cplusplus",
- }
- flags {
- "ExtraWarnings",
- }
if not _OPTIONS["NOWERROR"] then
flags{
"FatalWarnings",
@@ -1237,14 +1227,18 @@ configuration { "vs20*" }
"userenv",
}
+if _OPTIONS["vs"]==nil then
buildoptions {
- "/Zc:preprocessor",
- "/utf-8",
+ "/bigobj",
"/permissive-",
- "/w45038", -- warning C5038: data member 'member1' will be initialized after data member 'member2'
+ "/utf-8",
+ "/Zc:enumTypes",
+ "/Zc:preprocessor",
+ "/Zc:templateScope",
}
buildoptions {
+ "/w45038", -- warning C5038: data member 'member1' will be initialized after data member 'member2'
"/wd4018", -- warning C4018: 'x' : signed/unsigned mismatch
"/wd4060", -- warning C4060: switch statement contains no 'case' or 'default' labels
"/wd4065", -- warning C4065: switch statement contains 'default' but no 'case' labels
@@ -1275,7 +1269,18 @@ configuration { "vs20*" }
"/wd4996", -- warning C4996: 'function': was declared deprecated
}
-if _OPTIONS["vs"]=="intel-15" then
+ buildoptions_cpp {
+ "/Zc:__cplusplus",
+ }
+
+ flags {
+ "ExtraWarnings",
+ }
+elseif _OPTIONS["vs"]=="intel-15" then
+ buildoptions {
+ "/bigobj",
+ }
+
buildoptions {
"/Qwd9", -- remark #9: nested comment is not allowed
"/Qwd82", -- remark #82: storage class is not first
@@ -1310,36 +1315,32 @@ if _OPTIONS["vs"]=="intel-15" then
"/Qwd11074", -- remark #11074: Inlining inhibited by limit max-size / remark #11074: Inlining inhibited by limit max-total-size
"/Qwd11075", -- remark #11075: To get full report use -Qopt-report:4 -Qopt-report-phase ipo
}
-end
-if _OPTIONS["vs"]=="clangcl" then
+ flags {
+ "ExtraWarnings",
+ }
+elseif _OPTIONS["vs"]=="clangcl" then
buildoptions {
- "-Wno-enum-conversion",
"-Wno-ignored-qualifiers",
- "-Wno-missing-braces",
- "-Wno-missing-field-initializers",
"-Wno-new-returns-null",
- "-Wno-nonportable-include-path",
- "-Wno-pointer-bool-conversion",
- "-Wno-pragma-pack",
- "-Wno-switch",
- "-Wno-tautological-constant-out-of-range-compare",
- "-Wno-tautological-pointer-compare",
- "-Wno-unknown-warning-option",
"-Wno-unused-const-variable",
- "-Wno-unused-function",
"-Wno-unused-label",
- "-Wno-unused-local-typedef",
"-Wno-unused-private-field",
- "-Wno-unused-variable",
"-Wno-xor-used-as-pow",
- "-Wno-microsoft-cast",
+ "-Wno-error=deprecated-declarations",
+ "-Wno-error=tautological-compare",
}
-end
+ if _OPTIONS["DEPRECATED"]=="0" then
+ buildoptions {
+ "-Wno-deprecated-declarations"
+ }
+ end
- linkoptions {
- "/ignore:4221", -- LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
+ flags {
+ -- don't set ExtraWarnings flag (/W4 == -Wall -Wextra); use default (/W3 == -Wall) instead
}
+end
+
includedirs {
MAME_DIR .. "3rdparty/dxsdk/Include"
}
diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua
index b08e847a9ae..4ff6d82e968 100755
--- a/scripts/src/3rdparty.lua
+++ b/scripts/src/3rdparty.lua
@@ -75,13 +75,14 @@ if BASE_TARGETOS=="unix" then
end
configuration { "vs*" }
+if _OPTIONS["vs"]==nil then
buildoptions {
"/wd4100", -- warning C4100: 'xxx' : unreferenced formal parameter
"/wd4127", -- warning C4127: conditional expression is constant
"/wd4244", -- warning C4244: 'argument' : conversion from 'xxx' to 'xxx', possible loss of data
"/wd4456", -- warning C4456: declaration of 'xxx' hides previous local declaration
}
-if _OPTIONS["vs"]=="intel-15" then
+elseif _OPTIONS["vs"]=="intel-15" then
buildoptions {
"/Qwd111", -- remark #111: statement is unreachable
"/Qwd1879", -- warning #1879: unimplemented pragma ignored
@@ -135,11 +136,12 @@ project "zlib"
end
configuration { "vs*" }
+if _OPTIONS["vs"]==nil then
buildoptions {
"/wd4127", -- warning C4127: conditional expression is constant
"/wd4244", -- warning C4244: 'argument' : conversion from 'xxx' to 'xxx', possible loss of data
}
-if _OPTIONS["vs"]=="intel-15" then
+elseif _OPTIONS["vs"]=="intel-15" then
buildoptions {
"/Qwd111", -- remark #111: statement is unreachable
"/Qwd280", -- remark #280: selector expression is constant
@@ -189,6 +191,13 @@ project "zstd"
"NDEBUG",
}
+ configuration { "vs*" }
+if _OPTIONS["vs"]=="clangcl" then
+ buildoptions {
+ "-Wno-error=unused-function",
+ }
+end
+
configuration { }
defines {
@@ -254,12 +263,13 @@ project "softfloat"
}
configuration { "vs*" }
+if _OPTIONS["vs"]==nil then
buildoptions {
"/wd4244", -- warning C4244: 'argument' : conversion from 'xxx' to 'xxx', possible loss of data
"/wd4146", -- warning C4146: unary minus operator applied to unsigned type, result still unsigned
"/wd4018", -- warning C4018: 'x' : signed/unsigned mismatch
}
-if _OPTIONS["vs"]=="intel-15" then
+elseif _OPTIONS["vs"]=="intel-15" then
buildoptions {
"/Qwd2557", -- remark #2557: comparison between signed and unsigned operands
}
@@ -307,10 +317,12 @@ if _OPTIONS["gcc"]~=nil and not string.find(_OPTIONS["gcc"], "clang") then
end
configuration { "vs*" }
+if _OPTIONS["vs"]==nil then
buildoptions {
"/wd4701", -- warning C4701: potentially uninitialized local variable 'xxx' used
"/wd4703", -- warning C4703: potentially uninitialized local pointer variable 'xxx' used
}
+end
configuration { }
@@ -649,12 +661,13 @@ project "jpeg"
kind "StaticLib"
configuration { "vs*" }
+if _OPTIONS["vs"]==nil then
buildoptions {
"/wd4100", -- warning C4100: 'xxx' : unreferenced formal parameter
"/wd4127", -- warning C4127: conditional expression is constant
"/wd4244", -- warning C4244: 'argument' : conversion from 'xxx' to 'xxx', possible loss of data
}
-if _OPTIONS["vs"]=="intel-15" then
+elseif _OPTIONS["vs"]=="intel-15" then
buildoptions {
"/Qwd869", -- remark #869: parameter "xxx" was never referenced
}
@@ -727,6 +740,7 @@ project "flac"
kind "StaticLib"
configuration { "vs*" }
+if _OPTIONS["vs"]==nil then
buildoptions {
"/wd4057", -- warning C4057: 'operator': 'identifier1' differs in indirection to slightly different base types from 'identifier2'
"/wd4127", -- warning C4127: conditional expression is constant
@@ -735,7 +749,7 @@ project "flac"
"/wd4456", -- warning C4456: declaration of 'xxx' hides previous local declaration
"/wd4702", -- warning C4702: unreachable code
}
-if _OPTIONS["vs"]=="intel-15" then
+elseif _OPTIONS["vs"]=="intel-15" then
buildoptions {
"/Qwd111", -- remark #111: statement is unreachable
"/Qwd177", -- remark #177: function "xxx" was declared but never referenced
@@ -890,12 +904,13 @@ if _OPTIONS["gcc"]~=nil then
end
configuration { "vs*" }
+if _OPTIONS["vs"]==nil then
buildoptions {
"/wd4100", -- warning C4100: 'xxx' : unreferenced formal parameter
"/wd4456", -- warning C4456: declaration of 'xxx' hides previous local declaration
"/wd4457", -- warning C4457: declaration of 'xxx' hides function parameter
}
-if _OPTIONS["vs"]=="intel-15" then
+elseif _OPTIONS["vs"]=="intel-15" then
buildoptions {
"/Qwd869", -- remark #869: parameter "xxx" was never referenced
}
@@ -977,13 +992,14 @@ project "lua"
}
configuration { "vs*" }
+if _OPTIONS["vs"]==nil then
buildoptions {
"/wd4101", -- warning C4101: 'identifier': unreferenced local variable
"/wd4244", -- warning C4244: 'argument' : conversion from 'xxx' to 'xxx', possible loss of data
"/wd4702", -- warning C4702: unreachable code
"/wd4310", -- warning C4310: cast truncates constant value
}
-if _OPTIONS["vs"]=="intel-15" then
+elseif _OPTIONS["vs"]=="intel-15" then
buildoptions {
"/Qwd592", -- error #592: variable "xxx" is used before its value is set
}
@@ -1069,6 +1085,7 @@ project "lualibs"
}
configuration { "vs*" }
+if _OPTIONS["vs"]==nil then
buildoptions {
"/wd4101", -- warning C4101: 'identifier': unreferenced local variable
"/wd4244", -- warning C4244: 'argument' : conversion from 'xxx' to 'xxx', possible loss of data
@@ -1076,6 +1093,11 @@ project "lualibs"
"/wd4152", -- warning C4152: nonstandard extension, function/data pointer conversion in expression
"/wd4130", -- warning C4130: '==': logical operation on address of string constant
}
+elseif _OPTIONS["vs"]=="clangcl" then
+ buildoptions {
+ "-Wno-error=unused-variable",
+ }
+end
configuration { }
defines {
@@ -1134,7 +1156,8 @@ end
configuration { "vs*" }
if _OPTIONS["vs"]=="clangcl" then
buildoptions {
- "-Wno-implicit-int-float-conversion",
+ "-Wno-unused-but-set-variable",
+ "-Wno-unused-variable",
}
end
@@ -1168,6 +1191,7 @@ project "portmidi"
}
configuration { "vs*" }
+if _OPTIONS["vs"]==nil then
buildoptions {
"/wd4100", -- warning C4100: 'xxx' : unreferenced formal parameter
"/wd4127", -- warning C4127: conditional expression is constant
@@ -1175,13 +1199,19 @@ project "portmidi"
"/wd4456", -- warning C4456: declaration of 'xxx' hides previous local declaration
"/wd4706", -- warning C4706: assignment within conditional expression
}
-if _OPTIONS["vs"]=="intel-15" then
+elseif _OPTIONS["vs"]=="intel-15" then
buildoptions {
"/Qwd188", -- error #188: enumerated type mixed with another type
"/Qwd344", -- remark #344: typedef name has already been declared (with same type)
"/Qwd869", -- remark #869: parameter "xxx" was never referenced
"/Qwd2557", -- remark #2557: comparison between signed and unsigned operands
}
+elseif _OPTIONS["vs"]=="clangcl" then
+ buildoptions {
+ "-Wno-unused-but-set-variable",
+ "-Wno-unused-function",
+ "-Wno-unused-variable",
+ }
end
configuration { "linux*" }
@@ -1469,6 +1499,7 @@ project "bgfx"
kind "StaticLib"
configuration { "vs*" }
+if _OPTIONS["vs"]==nil then
buildoptions {
"/wd4324", -- warning C4324: 'xxx' : structure was padded due to __declspec(align())
"/wd4244", -- warning C4244: 'argument' : conversion from 'xxx' to 'xxx', possible loss of data
@@ -1476,14 +1507,21 @@ project "bgfx"
"/wd4310", -- warning C4310: cast truncates constant value
"/wd4701", -- warning C4701: potentially uninitialized local variable 'xxx' used
}
-
-if _OPTIONS["vs"]=="intel-15" then
+elseif _OPTIONS["vs"]=="intel-15" then
buildoptions {
"/Qwd906", -- message #906: effect of this "#pragma pack" directive is local to function "xxx"
"/Qwd1879", -- warning #1879: unimplemented pragma ignored
"/Qwd82", -- remark #82: storage class is not first
}
+elseif _OPTIONS["vs"]=="clangcl" then
+ buildoptions {
+ "-Wno-uninitialized",
+ "-Wno-unused-but-set-variable",
+ "-Wno-unused-function",
+ "-Wno-unused-variable",
+ }
end
+
configuration { }
includedirs {
@@ -1504,6 +1542,7 @@ end
includedirs {
MAME_DIR .. "3rdparty/bx/include/compat/msvc",
}
+
configuration { "mingw*" }
includedirs {
MAME_DIR .. "3rdparty/bx/include/compat/mingw",
@@ -1659,6 +1698,7 @@ project "portaudio"
kind "StaticLib"
configuration { "vs*" }
+if _OPTIONS["vs"]==nil then
buildoptions {
"/wd4245", -- warning C4245: 'conversion' : conversion from 'type1' to 'type2', signed/unsigned mismatch
"/wd4244", -- warning C4244: 'argument' : conversion from 'xxx' to 'xxx', possible loss of data
@@ -1668,22 +1708,28 @@ project "portaudio"
"/wd4127", -- warning C4127: conditional expression is constant
"/wd4456", -- warning C4456: declaration of 'xxx' hides previous local declaration
"/wd4312", -- warning C4312: 'type cast': conversion from 'UINT' to 'HWAVEIN' of greater size
+ "/wd4204", -- warning C4204: nonstandard extension used : non-constant aggregate initializer
+ "/wd4701", -- warning C4701: potentially uninitialized local variable 'xxx' used
+ "/wd4057", -- warning C4057: 'function': 'xxx' differs in indirection to slightly different base types from 'xxx'
}
- if _OPTIONS["vs"]=="clangcl" then
+elseif _OPTIONS["vs"]=="intel-15" then
buildoptions {
+ "/Qwd869", -- remark #869: parameter "xxx" was never referenced
+ "/Qwd1478", -- warning #1478: function "xxx" (declared at line yyy of "zzz") was declared deprecated
+ "/Qwd2544", -- message #2544: empty dependent statement in if-statement
+ "/Qwd1879", -- warning #1879: unimplemented pragma ignored
+ }
+elseif _OPTIONS["vs"]=="clangcl" then
+ buildoptions {
+ "-Wno-missing-braces",
"-Wno-implicit-const-int-float-conversion",
"-Wno-sometimes-uninitialized",
"-Wno-unused-but-set-variable",
+ "-Wno-unused-function",
+ "-Wno-unused-variable",
+ "-Wno-switch",
}
- end
- if _OPTIONS["vs"]=="intel-15" then
- buildoptions {
- "/Qwd869", -- remark #869: parameter "xxx" was never referenced
- "/Qwd1478", -- warning #1478: function "xxx" (declared at line yyy of "zzz") was declared deprecated
- "/Qwd2544", -- message #2544: empty dependent statement in if-statement
- "/Qwd1879", -- warning #1879: unimplemented pragma ignored
- }
- end
+end
configuration { "gmake or ninja" }
buildoptions_c {
@@ -1727,12 +1773,6 @@ project "portaudio"
}
end
end
- configuration { "vs*" }
- buildoptions {
- "/wd4204", -- warning C4204: nonstandard extension used : non-constant aggregate initializer
- "/wd4701", -- warning C4701: potentially uninitialized local variable 'xxx' used
- "/wd4057", -- warning C4057: 'function': 'xxx' differs in indirection to slightly different base types from 'xxx'
- }
configuration { }
@@ -1833,9 +1873,11 @@ project "linenoise"
addprojectflags()
configuration { "vs*" }
+if _OPTIONS["vs"]==nil then
buildoptions {
"/wd4701", -- warning C4701: potentially uninitialized local variable 'xxx' used
}
+end
configuration { }