Skip to content

Commit da2c0fe

Browse files
committed
Make JSON chunk functionality conditional for VC6 builds
1 parent e390b91 commit da2c0fe

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

Core/GameEngine/CMakeLists.txt

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +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
60+
$<$<NOT:$<BOOL:${IS_VS6_BUILD}>>:Include/Common/JSONChunkInput.h>
61+
$<$<NOT:$<BOOL:${IS_VS6_BUILD}>>:Include/Common/JSONChunkOutput.h>
6262
# Include/Common/GlobalData.h
6363
# Include/Common/Handicap.h
6464
# Include/Common/IgnorePreferences.h
@@ -648,8 +648,8 @@ set(GAMEENGINE_SRC
648648
# Source/Common/System/CriticalSection.cpp
649649
# Source/Common/System/DataChunk.cpp
650650
Source/Common/System/Debug.cpp
651-
Source/Common/System/JSONChunkInput.cpp
652-
Source/Common/System/JSONChunkOutput.cpp
651+
$<$<NOT:$<BOOL:${IS_VS6_BUILD}>>:Source/Common/System/JSONChunkInput.cpp>
652+
$<$<NOT:$<BOOL:${IS_VS6_BUILD}>>:Source/Common/System/JSONChunkOutput.cpp>
653653
# Source/Common/System/Directory.cpp
654654
# Source/Common/System/DisabledTypes.cpp
655655
# Source/Common/System/encrypt.cpp
@@ -1168,14 +1168,19 @@ else()
11681168
endif()
11691169

11701170

1171-
find_package(nlohmann_json CONFIG)
1172-
if (TARGET nlohmann_json::nlohmann_json)
1173-
# Uses nlohmann-json from vcpkg
1174-
set(NLOHMANN_JSON_TARGET nlohmann_json::nlohmann_json)
1171+
if (NOT IS_VS6_BUILD)
1172+
find_package(nlohmann_json CONFIG)
1173+
if (TARGET nlohmann_json::nlohmann_json)
1174+
# Uses nlohmann-json from vcpkg
1175+
set(NLOHMANN_JSON_TARGET nlohmann_json::nlohmann_json)
1176+
else()
1177+
# Uses nlohmann-json from github repository
1178+
include(${CMAKE_SOURCE_DIR}/cmake/nlohmann-json.cmake)
1179+
set(NLOHMANN_JSON_TARGET nlohmann_json)
1180+
endif()
11751181
else()
1176-
# Uses nlohmann-json from github repository
1177-
include(${CMAKE_SOURCE_DIR}/cmake/nlohmann-json.cmake)
1178-
set(NLOHMANN_JSON_TARGET nlohmann_json)
1182+
# VC6 doesn't support C++11, so nlohmann-json is not available
1183+
set(NLOHMANN_JSON_TARGET "")
11791184
endif()
11801185

11811186
add_library(corei_gameengine_private INTERFACE)
@@ -1212,5 +1217,5 @@ target_link_libraries(corei_gameengine_public INTERFACE
12121217
d3d8lib
12131218
gamespy::gamespy
12141219
stlport
1215-
${NLOHMANN_JSON_TARGET}
1220+
$<$<NOT:$<BOOL:${IS_VS6_BUILD}>>:${NLOHMANN_JSON_TARGET}>
12161221
)

0 commit comments

Comments
 (0)