Skip to content

Commit 9f09235

Browse files
foxtaclesclaude
andcommitted
Fix /O2 regression on common code and typo'd CMAKE_C_FLAGS variables
The previous compile-options change moved /O2 from the global CMAKE_CXX_FLAGS_RELWITHDEBINFO to a target-specific COMPILE_OPTIONS on only `goldp` and `legoracers`. That dropped `common_goldp` and `common_legoracers` to no optimization, breaking match for any function in common code (e.g. GolFatalError 100% -> 15.58%, GolNameTable methods, GolImgFile, GolTgaFile). Add common_goldp and common_legoracers to the same target list so they get the same /O2 / /Od / /Os config-dependent flags as goldp/legoracers. Also fix the CMAKE_C_FLAGS_* variable references which had stray "XX" infixes ("CMAKE_C_FLAGSXX_DEBUG" instead of "CMAKE_CXX_FLAGS_DEBUG", etc.) — those expanded to empty strings and left the C compile flags effectively unset. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b72bd9e commit 9f09235

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

CMakeLists.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -452,10 +452,10 @@ if (MSVC_FOR_DECOMP)
452452
# Embed debug information (/Z7) for Debug and RelWithDebInfo configuration type
453453
set_property(TARGET goldp legoracers common_goldp common_legoracers PROPERTY MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>")
454454

455-
set_property(TARGET goldp legoracers APPEND PROPERTY COMPILE_OPTIONS "$<$<CONFIG:Release,RelWithDebInfo>:/O2>")
456-
set_property(TARGET goldp legoracers APPEND PROPERTY COMPILE_OPTIONS "$<$<CONFIG:Debug>:/Od>")
457-
set_property(TARGET goldp legoracers APPEND PROPERTY COMPILE_OPTIONS "$<$<CONFIG:MinSizeRel>:/Os>")
458-
set_property(TARGET goldp legoracers APPEND PROPERTY COMPILE_OPTIONS "$<$<NOT:$<CONFIG:Release,RelWithDebInfo,Debug,MinSizeRel>>:/Os>")
455+
set_property(TARGET goldp legoracers common_goldp common_legoracers APPEND PROPERTY COMPILE_OPTIONS "$<$<CONFIG:Release,RelWithDebInfo>:/O2>")
456+
set_property(TARGET goldp legoracers common_goldp common_legoracers APPEND PROPERTY COMPILE_OPTIONS "$<$<CONFIG:Debug>:/Od>")
457+
set_property(TARGET goldp legoracers common_goldp common_legoracers APPEND PROPERTY COMPILE_OPTIONS "$<$<CONFIG:MinSizeRel>:/Os>")
458+
set_property(TARGET goldp legoracers common_goldp common_legoracers APPEND PROPERTY COMPILE_OPTIONS "$<$<NOT:$<CONFIG:Release,RelWithDebInfo,Debug,MinSizeRel>>:/Os>")
459459

460460
set(CMAKE_CXX_FLAGS "/W3 /GX /DWIN32 /D_WINDOWS")
461461
set(CMAKE_CXX_FLAGS_DEBUG "/Gm /D_DEBUG")
@@ -464,10 +464,10 @@ if (MSVC_FOR_DECOMP)
464464
set(CMAKE_CXX_FLAGS_MINSIZEREL "/DNDEBUG")
465465

466466
set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS}")
467-
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGSXX_DEBUG}")
468-
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RXXELEASE}")
469-
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDXXEBINFO}")
470-
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSXXIZEREL}")
467+
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
468+
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
469+
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
470+
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}")
471471

472472
set(CMAKE_EXE_LINKER_FLAGS "/machine:I386")
473473
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/incremental:yes /debug")

0 commit comments

Comments
 (0)