build: refresh toolchain and dependency wiring
This commit is contained in:
@@ -109,8 +109,9 @@ if(APPLE)
|
||||
)
|
||||
|
||||
if(YAZE_ENABLE_JSON)
|
||||
target_include_directories(yaze_app_objcxx PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/ext/json/include)
|
||||
if(TARGET nlohmann_json::nlohmann_json)
|
||||
target_link_libraries(yaze_app_objcxx PUBLIC nlohmann_json::nlohmann_json)
|
||||
endif()
|
||||
target_compile_definitions(yaze_app_objcxx PUBLIC YAZE_WITH_JSON)
|
||||
endif()
|
||||
|
||||
@@ -121,7 +122,7 @@ if(APPLE)
|
||||
if(NOT COCOA_LIBRARY)
|
||||
message(FATAL_ERROR "Cocoa not found")
|
||||
endif()
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-framework ServiceManagement -framework Foundation -framework Cocoa")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework ServiceManagement -framework Foundation -framework Cocoa")
|
||||
endif()
|
||||
|
||||
# Create the application core library
|
||||
@@ -139,13 +140,13 @@ target_include_directories(yaze_app_core_lib PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/src/app
|
||||
${CMAKE_SOURCE_DIR}/ext
|
||||
${CMAKE_SOURCE_DIR}/ext/imgui
|
||||
${CMAKE_SOURCE_DIR}/ext/json/include
|
||||
${CMAKE_SOURCE_DIR}/incl
|
||||
${SDL2_INCLUDE_DIR}
|
||||
${PROJECT_BINARY_DIR}
|
||||
)
|
||||
|
||||
if(YAZE_ENABLE_JSON)
|
||||
target_link_libraries(yaze_app_core_lib PUBLIC nlohmann_json::nlohmann_json)
|
||||
target_compile_definitions(yaze_app_core_lib PUBLIC YAZE_WITH_JSON)
|
||||
endif()
|
||||
|
||||
@@ -174,8 +175,6 @@ endif()
|
||||
|
||||
# gRPC Services (Optional)
|
||||
if(YAZE_WITH_GRPC)
|
||||
target_include_directories(yaze_app_core_lib PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/ext/json/include)
|
||||
target_compile_definitions(yaze_app_core_lib PRIVATE YAZE_WITH_JSON)
|
||||
# Link to consolidated gRPC support library
|
||||
target_link_libraries(yaze_app_core_lib PUBLIC yaze_grpc_support)
|
||||
|
||||
@@ -112,6 +112,7 @@ set(
|
||||
app/editor/layout_designer/widget_code_generator.cc
|
||||
app/editor/layout_designer/theme_properties.cc
|
||||
app/editor/layout_designer/yaze_widgets.cc
|
||||
yaze.cc
|
||||
)
|
||||
|
||||
# Agent UI Theme is always needed (used by dungeon editor, etc.)
|
||||
@@ -193,9 +194,6 @@ endif()
|
||||
# Note: yaze_test_support linking is deferred to test.cmake to ensure proper ordering
|
||||
|
||||
if(YAZE_ENABLE_JSON)
|
||||
target_include_directories(yaze_editor PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/ext/json/include)
|
||||
|
||||
if(TARGET nlohmann_json::nlohmann_json)
|
||||
target_link_libraries(yaze_editor PUBLIC nlohmann_json::nlohmann_json)
|
||||
endif()
|
||||
|
||||
@@ -57,8 +57,6 @@ target_include_directories(yaze_net PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/src
|
||||
${CMAKE_SOURCE_DIR}/ext
|
||||
${CMAKE_SOURCE_DIR}/ext/imgui
|
||||
${CMAKE_SOURCE_DIR}/ext/json/include
|
||||
${CMAKE_SOURCE_DIR}/ext/httplib
|
||||
${PROJECT_BINARY_DIR}
|
||||
)
|
||||
|
||||
@@ -69,6 +67,10 @@ target_link_libraries(yaze_net PUBLIC
|
||||
${YAZE_SDL2_TARGETS}
|
||||
)
|
||||
|
||||
if(NOT EMSCRIPTEN AND YAZE_HTTPLIB_TARGETS)
|
||||
target_link_libraries(yaze_net PUBLIC ${YAZE_HTTPLIB_TARGETS})
|
||||
endif()
|
||||
|
||||
# Add Emscripten-specific flags for WASM builds
|
||||
if(EMSCRIPTEN)
|
||||
# Enable Fetch API for HTTP requests
|
||||
@@ -87,7 +89,6 @@ endif()
|
||||
if(YAZE_ENABLE_JSON)
|
||||
# Link nlohmann_json which provides the include directories automatically
|
||||
target_link_libraries(yaze_net PUBLIC nlohmann_json::nlohmann_json)
|
||||
target_include_directories(yaze_net PUBLIC ${CMAKE_SOURCE_DIR}/ext/httplib)
|
||||
target_compile_definitions(yaze_net PUBLIC YAZE_WITH_JSON)
|
||||
|
||||
# Add threading support (cross-platform)
|
||||
|
||||
@@ -58,8 +58,7 @@ target_link_libraries(yaze_grpc_support PUBLIC
|
||||
|
||||
# Add JSON support
|
||||
if(YAZE_ENABLE_JSON)
|
||||
target_include_directories(yaze_grpc_support PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/ext/json/include)
|
||||
target_link_libraries(yaze_grpc_support PUBLIC nlohmann_json::nlohmann_json)
|
||||
target_compile_definitions(yaze_grpc_support PUBLIC YAZE_WITH_JSON)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -45,8 +45,6 @@ target_link_libraries(yaze_test_support PUBLIC
|
||||
|
||||
# Add gRPC dependencies if test harness is enabled
|
||||
if(YAZE_WITH_GRPC)
|
||||
target_include_directories(yaze_test_support PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/ext/json/include)
|
||||
target_compile_definitions(yaze_test_support PRIVATE YAZE_WITH_JSON)
|
||||
|
||||
# Link to consolidated gRPC support library
|
||||
@@ -80,4 +78,4 @@ message(STATUS "✓ yaze_test_support library configured")
|
||||
# Note: yaze_editor needs yaze_test_support for TestManager, but we can't link it here
|
||||
# because this happens BEFORE yaze and yaze_emu are configured.
|
||||
# Instead, each executable (yaze, yaze_emu) must explicitly link yaze_test_support
|
||||
# in their respective .cmake files (app.cmake, emu.cmake).
|
||||
# in their respective .cmake files (app.cmake, emu.cmake).
|
||||
|
||||
@@ -87,7 +87,6 @@ if(EMSCRIPTEN)
|
||||
|
||||
# Add JSON support for API communication
|
||||
if(YAZE_ENABLE_JSON)
|
||||
target_include_directories(yaze_agent PUBLIC ${CMAKE_SOURCE_DIR}/ext/json/include)
|
||||
target_link_libraries(yaze_agent PUBLIC nlohmann_json::nlohmann_json)
|
||||
target_compile_definitions(yaze_agent PUBLIC YAZE_WITH_JSON)
|
||||
endif()
|
||||
@@ -288,6 +287,10 @@ endif()
|
||||
|
||||
target_link_libraries(yaze_agent PUBLIC ${_yaze_agent_link_targets})
|
||||
|
||||
if(NOT EMSCRIPTEN AND YAZE_HTTPLIB_TARGETS)
|
||||
target_link_libraries(yaze_agent PUBLIC ${YAZE_HTTPLIB_TARGETS})
|
||||
endif()
|
||||
|
||||
# Ensure yaml-cpp include paths propagate even when using system packages
|
||||
if(YAZE_ENABLE_AI_RUNTIME)
|
||||
set(_yaml_targets_to_check ${YAZE_YAML_TARGETS} yaml-cpp yaml-cpp::yaml-cpp)
|
||||
@@ -306,24 +309,21 @@ target_include_directories(yaze_agent
|
||||
PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/src
|
||||
${CMAKE_SOURCE_DIR}/incl
|
||||
${CMAKE_SOURCE_DIR}/ext/httplib
|
||||
${CMAKE_SOURCE_DIR}/src/lib
|
||||
${CMAKE_SOURCE_DIR}/src/cli/handlers
|
||||
${CMAKE_BINARY_DIR}/gens
|
||||
)
|
||||
|
||||
if(YAZE_ENABLE_AI_RUNTIME AND YAZE_ENABLE_JSON)
|
||||
target_include_directories(yaze_agent PUBLIC ${CMAKE_SOURCE_DIR}/ext/json/include)
|
||||
endif()
|
||||
|
||||
if(SDL2_INCLUDE_DIR)
|
||||
target_include_directories(yaze_agent PUBLIC ${SDL2_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
if(YAZE_ENABLE_AI_RUNTIME AND YAZE_ENABLE_JSON)
|
||||
if(YAZE_ENABLE_JSON)
|
||||
target_link_libraries(yaze_agent PUBLIC nlohmann_json::nlohmann_json)
|
||||
target_compile_definitions(yaze_agent PUBLIC YAZE_WITH_JSON)
|
||||
endif()
|
||||
|
||||
if(YAZE_ENABLE_AI_RUNTIME AND YAZE_ENABLE_JSON)
|
||||
# Only link OpenSSL if gRPC is NOT enabled (to avoid duplicate symbol errors)
|
||||
# When gRPC is enabled, it brings its own OpenSSL which we'll use instead
|
||||
if(NOT YAZE_ENABLE_REMOTE_AUTOMATION)
|
||||
|
||||
@@ -155,7 +155,7 @@ Access-Control-Allow-Origin: *
|
||||
### Architecture
|
||||
|
||||
The HTTP API is built using:
|
||||
- **cpp-httplib** - Header-only HTTP server library (`ext/httplib/`)
|
||||
- **cpp-httplib** - Header-only HTTP server library (fetched via CPM)
|
||||
- **nlohmann/json** - JSON serialization/deserialization
|
||||
- **ModelRegistry** - Unified model management across providers
|
||||
|
||||
|
||||
@@ -48,9 +48,6 @@ target_link_libraries(yaze_core_lib PUBLIC
|
||||
# JSON support for project serialization
|
||||
if(TARGET nlohmann_json::nlohmann_json)
|
||||
target_link_libraries(yaze_core_lib PUBLIC nlohmann_json::nlohmann_json)
|
||||
target_include_directories(yaze_core_lib PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/ext/json/include
|
||||
)
|
||||
endif()
|
||||
|
||||
# Add Asar support (links asar-static and adds YAZE_ENABLE_ASAR definition)
|
||||
|
||||
@@ -76,7 +76,6 @@ target_include_directories(yaze_zelda3 PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/src
|
||||
${CMAKE_SOURCE_DIR}/src/lib
|
||||
${CMAKE_SOURCE_DIR}/incl
|
||||
${CMAKE_SOURCE_DIR}/ext/json/include
|
||||
${PROJECT_BINARY_DIR}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user