build(cmake): Add retail compatibility option in CMake config - #2379
Conversation
|
| Filename | Overview |
|---|---|
| cmake/config-macros.cmake | Adds shared helpers for collecting compile-time guards and dispatching tri-state build options; no follow-up-eligible finding is retained. |
| cmake/config-retail.cmake | Adds the retail compatibility option, guard collection, and compiler compatibility notice; the previously questioned PRESERVE_* behavior was confirmed intentional. |
| cmake/config-debug.cmake | Migrates existing debug tri-state options to the shared helper. |
| cmake/config.cmake | Includes the new shared macro and retail configuration modules. |
Reviews (16): Last reviewed commit: "refactor(cmake): Improve guarded option ..." | Re-trigger Greptile
|
Looks good to me, is there a reason we're not just adding ALL of the gamedefines macros? eg USE_BUFFERED_IO, USE_OBSOLETE_GENERALS_CODE, TELL_COMPUTER_IDENTITY_IN_LAN_LOBBY. Also, maybe it's pedantic, but RTS_BUILD_OPTION_RETAIL_COMPATIBLE_PATHFINDING_ALLOCATION is probably a CMakeDependentOption of RTS_BUILD_OPTION_RETAIL_COMPATIBLE_PATHFINDING. Not needed though, this works as is. |
|
Should we revive this one? Are we using RTS_BUILD_OPTION_RETAIL_COMPATIBLE_GAME? adding ALL of the gamedefines macros? If the individual switches remain, PATHFINDING_ALLOCATION should be dependent on PATHFINDING, and CI should compile at least one non-default configuration. |
b3fca3b to
00cb6c5
Compare
|
Revived and simplified this based on the feedback. The individual switches have been replaced with a single I realized I didn't need to define every |
|
Should we have at least one of the RTS_BUILD_OPTION_RETAIL_COMPATIBLE_GAME set to OFF for ci? |
Was planning on doing that in a follow-up PR. |
|
Has unaddressed comments. Needs rebase |
00cb6c5 to
424974d
Compare
Rebased onto main and updated the description for the option to better reflect that turning it off enables all the non-retail gameplay and simulation fixes. |
424974d to
d833a31
Compare
d833a31 to
a77329a
Compare
a77329a to
8820b04
Compare
8820b04 to
848b888
Compare
This comment was marked as off-topic.
This comment was marked as off-topic.
848b888 to
d24c8df
Compare
d24c8df to
d0465a2
Compare
|
Updated to be tri-state and made it also detect Also warns when you use this feature with non-VC6SP6 compiler since that won't produce a truly retail-compatible build. |
d0465a2 to
81286ea
Compare
81286ea to
4eb2fad
Compare
eae6706 to
136101e
Compare
7fb6058 to
b32297e
Compare
Signed-off-by: tintinhamans <5984296+tintinhamans@users.noreply.github.com>
b32297e to
9108f41
Compare
| define_tristate_option(RTS_BUILD_OPTION_RETAIL_COMPATIBLE_GAME RetailCompatibleGame "Build with Retail Compatibility" "${_retail_guards}" "") | ||
| unset(_retail_guards) | ||
|
|
||
| if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL "12.0.8804" AND NOT RTS_BUILD_OPTION_RETAIL_COMPATIBLE_GAME STREQUAL "OFF") |
There was a problem hiding this comment.
Yes, CMake sees CMAKE_CXX_COMPILER_VERSION: 12.0.8804. You can confirm by looking at the configure output.

This pull request adds the
RTS_BUILD_OPTION_RETAIL_COMPATIBLE_GAMEconfigurationoption in
cmake/config-retail.cmaketo make it easier to build retail or non-retail.Will eventually be used for #2322
Tri-state, matching
cmake/config-debug.cmake:DEFAULTGameDefines.hONRETAIL_COMPATIBLE_*guards onOFFRETAIL_COMPATIBLE_*guards offThe guard list is read from
GameDefines.hat configure time, so new guards don't need CMake change.The
DEFAULT/ON/OFFdispatch is shared withconfig-debug.cmakevia new helper macros inconfig-macros.cmake(define_tristate_option).Only the VC6 SP6 compiler produces a build that is CRC-compatible with retail,
other toolchains get a note. Skipped when
OFF.