This commit is contained in:
seb
2026-07-13 07:34:17 +02:00
parent d471f2411d
commit b7b76c9d39
46 changed files with 39025 additions and 7 deletions

75
jtlsrv-cpp/CMakeLists.txt Normal file
View File

@@ -0,0 +1,75 @@
cmake_minimum_required(VERSION 3.16)
project(jtlsrv-cpp LANGUAGES C CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# --- Dependencies -----------------------------------------------------------
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBUV REQUIRED libuv)
pkg_check_modules(OPENSSL REQUIRED openssl)
pkg_check_modules(VIPS REQUIRED vips)
find_library(ODBC_LIBRARY odbc)
find_path(ODBC_INCLUDE_DIR sql.h)
# llhttp (vendored)
add_library(llhttp STATIC
vendor/llhttp.c
vendor/api.c
vendor/http.c
)
target_include_directories(llhttp PUBLIC vendor)
# nlohmann/json (vendored, header-only)
add_library(json INTERFACE)
target_include_directories(json INTERFACE vendor)
# --- jtlsrv -----------------------------------------------------------------
add_executable(jtlsrv
src/main.cpp
src/log.cpp
src/http.cpp
src/tls_server.cpp
src/pairing.cpp
src/router.cpp
src/endpoints/client.cpp
src/endpoints/init.cpp
src/endpoints/category.cpp
src/endpoints/product.cpp
src/endpoints/productcomposite.cpp
src/endpoints/deleted_entity.cpp
src/endpoints/customergroup.cpp
src/endpoints/order.cpp
src/endpoints/pimage.cpp
src/endpoints/cimage.cpp
src/db/pool.cpp
src/request_log.cpp
src/order_log.cpp
)
target_include_directories(jtlsrv PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
${LIBUV_INCLUDE_DIRS}
${OPENSSL_INCLUDE_DIRS}
${ODBC_INCLUDE_DIR}
${VIPS_INCLUDE_DIRS}
)
target_link_libraries(jtlsrv PRIVATE
llhttp
json
${LIBUV_LIBRARIES}
${OPENSSL_LIBRARIES}
${ODBC_LIBRARY}
${VIPS_LIBRARIES}
pthread
)
target_link_directories(jtlsrv PRIVATE
${LIBUV_LIBRARY_DIRS}
${OPENSSL_LIBRARY_DIRS}
${VIPS_LIBRARY_DIRS}
)