# cli/ produces the `velox` binary — the scriptable RPC client. Owned by lane DAEMON.
# Built early (AGENT-DAEMON.md build step 8, pulled forward): it is how the daemon is
# tested before the GUI exists.
#
# Links velox::proto for the wire types and error codes. It speaks the same NDJSON Unix
# socket veloxd listens on; no daemon code is linked.

if(NOT TARGET nlohmann_json::nlohmann_json)
    find_package(nlohmann_json 3.11 REQUIRED)
endif()

add_executable(velox
    src/main.cpp
    src/client.cpp
)
target_include_directories(velox PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
target_compile_features(velox PRIVATE cxx_std_23)
target_compile_options(velox PRIVATE -Wall -Wextra -Wpedantic -Werror)
target_link_libraries(velox PRIVATE velox::proto nlohmann_json::nlohmann_json)

if(VELOX_BUILD_TESTS AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tests/CMakeLists.txt)
    add_subdirectory(tests)
endif()
