Skip to content

Commit a787c6b

Browse files
committed
fix(websocket): configure json before core
1 parent fe69da7 commit a787c6b

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,24 @@ file(GLOB_RECURSE WEBSOCKET_SOURCES CONFIGURE_DEPENDS
4848
"${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp"
4949
)
5050

51+
# JSON dependency
52+
# Core needs vix::json to be available before it is configured.
53+
if (NOT TARGET vix::json AND NOT TARGET vix_json)
54+
if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/../json/CMakeLists.txt")
55+
message(STATUS "[websocket] Adding json from sibling: ../json")
56+
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/../json" "${CMAKE_CURRENT_BINARY_DIR}/json")
57+
endif()
58+
endif()
59+
60+
# Template dependency
61+
# Core can use vix::template if it is available before core is configured.
62+
if (NOT TARGET vix::template AND NOT TARGET template)
63+
if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/../template/CMakeLists.txt")
64+
message(STATUS "[websocket] Adding template from sibling: ../template")
65+
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/../template" "${CMAKE_CURRENT_BINARY_DIR}/template")
66+
endif()
67+
endif()
68+
5169
# Core dependency
5270
option(VIX_WEBSOCKET_FETCH_CORE "Auto-fetch vix::core if missing" ON)
5371
option(VIX_WEBSOCKET_FETCH_UTILS "Auto-fetch vix::utils if missing" ON)

0 commit comments

Comments
 (0)