@@ -57,6 +57,8 @@ set(GAMEENGINE_SRC
5757# Include/Common/GameType.h
5858 Include /Common/GameUtility.h
5959# Include/Common/Geometry.h
60+ # Include/Common/JSONChunkInput.h
61+ # Include/Common/JSONChunkOutput.h
6062# Include/Common/GlobalData.h
6163# Include/Common/Handicap.h
6264# Include/Common/IgnorePreferences.h
@@ -646,6 +648,8 @@ set(GAMEENGINE_SRC
646648# Source/Common/System/CriticalSection.cpp
647649# Source/Common/System/DataChunk.cpp
648650 Source /Common/System /Debug.cpp
651+ # Source/Common/System/JSONChunkInput.cpp
652+ # Source/Common/System/JSONChunkOutput.cpp
649653# Source/Common/System/Directory.cpp
650654# Source/Common/System/DisabledTypes.cpp
651655# Source/Common/System/encrypt.cpp
@@ -1145,6 +1149,15 @@ set(GAMEENGINE_SRC
11451149# Source/Precompiled/PreRTS.cpp
11461150)
11471151
1152+ if (NOT IS_VS6_BUILD)
1153+ list (APPEND GAMEENGINE_SRC
1154+ ${CMAKE_CURRENT_SOURCE_DIR} /Include /Common/JSONChunkInput.h
1155+ ${CMAKE_CURRENT_SOURCE_DIR} /Include /Common/JSONChunkOutput.h
1156+ ${CMAKE_CURRENT_SOURCE_DIR} /Source /Common/System /JSONChunkInput.cpp
1157+ ${CMAKE_CURRENT_SOURCE_DIR} /Source /Common/System /JSONChunkOutput.cpp
1158+ )
1159+ endif ()
1160+
11481161if (RTS_GAMEMEMORY_ENABLE)
11491162 # Uses the original Game Memory implementation.
11501163 list (APPEND GAMEENGINE_SRC
@@ -1164,6 +1177,21 @@ else()
11641177endif ()
11651178
11661179
1180+ if (NOT IS_VS6_BUILD)
1181+ find_package (nlohmann_json CONFIG)
1182+ if (TARGET nlohmann_json::nlohmann_json)
1183+ # Uses nlohmann-json from vcpkg
1184+ set (NLOHMANN_JSON_TARGET nlohmann_json::nlohmann_json)
1185+ else ()
1186+ # Uses nlohmann-json from github repository
1187+ include (${CMAKE_SOURCE_DIR} /cmake/nlohmann-json.cmake)
1188+ set (NLOHMANN_JSON_TARGET nlohmann_json)
1189+ endif ()
1190+ else ()
1191+ # VC6 doesn't support C++11, so nlohmann-json is not available
1192+ set (NLOHMANN_JSON_TARGET "" )
1193+ endif ()
1194+
11671195add_library (corei_gameengine_private INTERFACE )
11681196add_library (corei_gameengine_public INTERFACE )
11691197
@@ -1179,6 +1207,7 @@ target_link_libraries(corei_gameengine_private INTERFACE
11791207
11801208target_compile_definitions (corei_gameengine_private INTERFACE
11811209 IG_DEBUG_STACKTRACE
1210+ $<$<NOT :$<BOOL :${IS_VS6_BUILD} >>:RTS_HAS_JSON_CHUNK>
11821211)
11831212
11841213target_precompile_headers(corei_gameengine_private INTERFACE
@@ -1198,4 +1227,5 @@ target_link_libraries(corei_gameengine_public INTERFACE
11981227 d3d8lib
11991228 gamespy::gamespy
12001229 stlport
1230+ $<$<NOT :$<BOOL :${IS_VS6_BUILD} >>:${NLOHMANN_JSON_TARGET} >
12011231)
0 commit comments