zephyr/modules/thrift/CMakeLists.txt
Chris Friedt 0c00a3ea79 modules: add thrift module
Add glue code for the thrift module. This includes:
* workarounds for Zephyr's missing C++ facilities
* thrift config.h

This code was merged from the following repository
at the commit specified below, with minor formatting
and coding-style modifications.

https://github.com/zephyrproject-rtos/gsoc-2022-thrift
e12e014d295918cc5ba0b4c507d1bf595a2f539a

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2023-02-09 20:30:21 +09:00

44 lines
1.6 KiB
CMake

# Copyright 2022 Meta
# SPDX-License-Identifier: Apache-2.0
if(CONFIG_THRIFT)
set(THRIFT_UPSTREAM ${ZEPHYR_THRIFT_MODULE_DIR})
zephyr_library()
zephyr_include_directories(src)
zephyr_include_directories(include)
zephyr_include_directories(${THRIFT_UPSTREAM}/lib/cpp/src)
zephyr_library_sources(
src/_stat.c
src/thrift/server/TFDServer.cpp
${THRIFT_UPSTREAM}/lib/cpp/src/thrift/protocol/TProtocol.cpp
${THRIFT_UPSTREAM}/lib/cpp/src/thrift/server/TConnectedClient.cpp
${THRIFT_UPSTREAM}/lib/cpp/src/thrift/server/TSimpleServer.cpp
${THRIFT_UPSTREAM}/lib/cpp/src/thrift/transport/SocketCommon.cpp
${THRIFT_UPSTREAM}/lib/cpp/src/thrift/transport/TBufferTransports.cpp
${THRIFT_UPSTREAM}/lib/cpp/src/thrift/transport/TFDTransport.cpp
${THRIFT_UPSTREAM}/lib/cpp/src/thrift/transport/TTransportException.cpp
${THRIFT_UPSTREAM}/lib/cpp/src/thrift/transport/TServerSocket.cpp
${THRIFT_UPSTREAM}/lib/cpp/src/thrift/transport/TSocket.cpp
${THRIFT_UPSTREAM}/lib/cpp/src/thrift/TApplicationException.cpp
${THRIFT_UPSTREAM}/lib/cpp/src/thrift/TOutput.cpp
# Replace with upstream equivalents when Zephyr's std::thread, etc, are fixed
src/thrift/concurrency/Mutex.cpp
src/thrift/server/TServerFramework.cpp
)
zephyr_library_sources_ifdef(CONFIG_THRIFT_SSL_SOCKET
# Replace with upstream equivalents when Zephyr's std::thread, etc, are fixed
src/thrift/transport/TSSLSocket.cpp
src/thrift/transport/TSSLServerSocket.cpp
)
# needed because std::iterator was deprecated with -std=c++17
zephyr_library_compile_options(-Wno-deprecated-declarations)
endif(CONFIG_THRIFT)