Merge pull request #78120 from RedworkDE/msvc-icf

MSVC: Disable ICF (Identical COMDAT Folding) for `optimize=speed_trace`
This commit is contained in:
Rémi Verschelde 2023-06-12 11:56:44 +02:00
commit 8f575d2991
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -572,9 +572,12 @@ if selected_platform in platform_list:
env.Append(CCFLAGS=["/Zi", "/FS"])
env.Append(LINKFLAGS=["/DEBUG:FULL"])
if env["optimize"] == "speed" or env["optimize"] == "speed_trace":
if env["optimize"] == "speed":
env.Append(CCFLAGS=["/O2"])
env.Append(LINKFLAGS=["/OPT:REF"])
elif env["optimize"] == "speed_trace":
env.Append(CCFLAGS=["/O2"])
env.Append(LINKFLAGS=["/OPT:REF", "/OPT:NOICF"])
elif env["optimize"] == "size":
env.Append(CCFLAGS=["/O1"])
env.Append(LINKFLAGS=["/OPT:REF"])