@@ -33,6 +33,20 @@ endif()
3333# Top level project, doesn't really affect anything.
3434project (genzh LANGUAGES C CXX)
3535
36+ # Print some information
37+ message (STATUS "CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER} " )
38+ message (STATUS "CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID} " )
39+ if (DEFINED MSVC_VERSION )
40+ message (STATUS "MSVC_VERSION: ${MSVC_VERSION} " )
41+ endif ()
42+
43+ # Set variable for VS6 to handle special cases.
44+ if (DEFINED MSVC_VERSION AND MSVC_VERSION LESS 1300)
45+ set (IS_VS6_BUILD TRUE )
46+ else ()
47+ set (IS_VS6_BUILD FALSE )
48+ endif ()
49+
3650# Create PDB for Release as long as debug info was generated during compile.
3751if (MSVC )
3852 string (APPEND CMAKE_EXE_LINKER_FLAGS_RELEASE " /DEBUG /OPT:REF /OPT:ICF" )
@@ -57,6 +71,20 @@ add_subdirectory(Dependencies/Benchmark)
5771add_subdirectory (Dependencies/SafeDisc)
5872add_subdirectory (Dependencies/MaxSDK)
5973
74+ if (NOT IS_VS6_BUILD)
75+ # Set C++ standard
76+ set (CMAKE_CXX_STANDARD 20)
77+ set (CMAKE_CXX_STANDARD_REQUIRED ON )
78+ set (CMAKE_CXX_EXTENSIONS OFF ) # Ensures only ISO features are used
79+
80+ if (MSVC )
81+ # Multithreaded build.
82+ add_compile_options (/MP)
83+ # Enforce strict __cplusplus version
84+ add_compile_options (/Zc:__cplusplus)
85+ endif ()
86+ endif ()
87+
6088# Do we want to build extra SDK stuff or just the game binary?
6189option (GENZH_BUILD_ZEROHOUR "Build Zero Hour code." ON )
6290option (GENZH_BUILD_GENERALS "Build Generals code." ON )
0 commit comments