fix: don't set FavorSizeOrSpeed in vs backend if optimization disabled (/Od set).

Debugging is broken with clang-cl when FavorSizeOrSpeed is set.
This commit is contained in:
Luke Elliott 2021-01-10 15:54:20 +00:00 committed by Eli Schwartz
parent 673dca5c07
commit 4f0452b283
1 changed files with 2 additions and 1 deletions

View File

@ -1159,7 +1159,8 @@ class Vs2010Backend(backends.Backend):
# Size-preserving flags
if '/Os' in o_flags:
ET.SubElement(clconf, 'FavorSizeOrSpeed').text = 'Size'
else:
# Note: setting FavorSizeOrSpeed with clang-cl conflicts with /Od and can make debugging difficult, so don't.
elif '/Od' not in o_flags:
ET.SubElement(clconf, 'FavorSizeOrSpeed').text = 'Speed'
# Note: SuppressStartupBanner is /NOLOGO and is 'true' by default
self.generate_lang_standard_info(file_args, clconf)