mirror of
https://github.com/logos-co/logos-cpp-sdk.git
synced 2026-08-31 09:41:06 +00:00
The transport/token/IPC layer (transports incl. QRO + plain TCP/TLS, consumer core LogosAPIClient/LogosAPIConsumer with the capability auto-requestModule flow, ModuleProxy, token manager, QVariant<->JSON conversion, the abstract LogosProviderObject interface) now lives in the logos-protocol repo behind the versioned lp_* C ABI. This SDK keeps the typed C++ developer layer (LogosAPI, provider base classes + Qt provider glue, module context, code generator) and still compiles the protocol sources INTO liblogos_sdk.a from the flake input, so the installed artifact (archive symbols, include/ + include/cpp layouts, cmake config) stays byte-compatible: existing consumers need no changes. Public headers are unchanged; logos_provider_object.h keeps its name and now re-exports the abstract interface from logos_provider_interface.h. Transport/protocol component tests moved to logos-protocol with the code; the remaining sdk/generator/experimental suites are unchanged (432/432 green against the local protocol checkout).
64 lines
2.3 KiB
CMake
64 lines
2.3 KiB
CMake
cmake_minimum_required(VERSION 3.14)
|
|
project(LogosCppGenerator)
|
|
|
|
set(CMAKE_CXX_STANDARD 11)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
# Find Qt Core (QCoreApplication, QPluginLoader, QJson*)
|
|
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
|
|
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
|
|
|
|
add_executable(logos-cpp-generator
|
|
main.cpp
|
|
legacy/main.cpp
|
|
legacy/generator_lib.cpp
|
|
experimental/lidl_lexer.cpp
|
|
experimental/lidl_parser.cpp
|
|
experimental/lidl_serializer.cpp
|
|
experimental/lidl_validator.cpp
|
|
experimental/lidl_gen_client.cpp
|
|
experimental/lidl_gen_provider.cpp
|
|
experimental/impl_header_parser.cpp
|
|
)
|
|
|
|
target_link_libraries(logos-cpp-generator PRIVATE Qt${QT_VERSION_MAJOR}::Core)
|
|
|
|
# nlohmann_json: pulled in transitively by logos_provider_object.h →
|
|
# logos_provider_interface.h / logos_json_convert.h (header-only use).
|
|
find_package(nlohmann_json REQUIRED)
|
|
target_link_libraries(logos-cpp-generator PRIVATE nlohmann_json::nlohmann_json)
|
|
|
|
# logos-protocol headers (logos_provider_interface.h, logos_json_convert.h —
|
|
# included transitively via ../cpp/logos_provider_object.h). Header-only:
|
|
# the generator does not link the protocol library. Resolution mirrors
|
|
# cpp/CMakeLists.txt: -DLOGOS_PROTOCOL_ROOT / env / sibling checkout.
|
|
if(NOT DEFINED LOGOS_PROTOCOL_ROOT)
|
|
if(DEFINED ENV{LOGOS_PROTOCOL_ROOT})
|
|
set(LOGOS_PROTOCOL_ROOT "$ENV{LOGOS_PROTOCOL_ROOT}")
|
|
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../logos-protocol/cpp/logos_protocol.h")
|
|
set(LOGOS_PROTOCOL_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../../logos-protocol")
|
|
endif()
|
|
endif()
|
|
if(EXISTS "${LOGOS_PROTOCOL_ROOT}/cpp/logos_protocol.h")
|
|
set(LP_INCLUDE "${LOGOS_PROTOCOL_ROOT}/cpp")
|
|
elseif(EXISTS "${LOGOS_PROTOCOL_ROOT}/include/cpp/logos_protocol.h")
|
|
set(LP_INCLUDE "${LOGOS_PROTOCOL_ROOT}/include/cpp")
|
|
else()
|
|
message(FATAL_ERROR "logos-protocol headers not found. Set LOGOS_PROTOCOL_ROOT "
|
|
"(CMake or environment variable).")
|
|
endif()
|
|
|
|
target_include_directories(logos-cpp-generator PRIVATE
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
${CMAKE_CURRENT_SOURCE_DIR}/legacy
|
|
${CMAKE_CURRENT_SOURCE_DIR}/experimental
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../cpp
|
|
${LP_INCLUDE}
|
|
)
|
|
|
|
# Output directories
|
|
set_target_properties(logos-cpp-generator PROPERTIES
|
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
|
|
)
|