Fix x86 build, tweak MSVC opt flags.
Use: /Ot /Oy /Ob3 /GF /Gy , instead of /O2 for x86, this makes it not crash on ROM load for the OpenGL renderer. Supposedly /O2 is equivalent to: /Og /Oi /Ot /Oy /Ob2 /GF /Gy , but the documentation states that /Og is automatically enabled when any other optimizations are enabled automatically. So this should make absolutely no difference, yet it does. For x64 use: /O2 /Ob3 , this overrides /Ob2 from /O2 to use more aggressive inlining, VS 2019 is required for this. Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
parent
73223445d6
commit
c4733bcf03
|
@ -749,7 +749,14 @@ elseif(MSVC)
|
|||
if(CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
add_compile_options(/W4)
|
||||
else()
|
||||
add_compile_options(/w /O2)
|
||||
add_compile_options(/w)
|
||||
|
||||
if(X86_32)
|
||||
add_compile_options(/Ot /Oy /Ob3 /GF /Gy)
|
||||
else()
|
||||
add_compile_options(/O2 /Ob3)
|
||||
endif()
|
||||
|
||||
|
||||
if(ENABLE_LTO)
|
||||
add_compile_options(/GL)
|
||||
|
|
Loading…
Reference in New Issue