The Thrift library makes use of POSIX C functions such as ctime_r(), which are not part of the ISO C standard. This commit adds a Thrift module-wide `_POSIX_C_SOURCE` feature test macro definition in order to ensure that the required POSIX C functions are available when compiling the Thrift library. Note that this was not caught earlier because Newlib and older versions of Picolibc did not properly fence off some POSIX functions behind the feature test macros. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
45 lines
1.6 KiB
CMake
45 lines
1.6 KiB
CMake
# Copyright 2022 Meta
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
if(CONFIG_THRIFT)
|
|
|
|
zephyr_library()
|
|
|
|
zephyr_library_include_directories(
|
|
src
|
|
include
|
|
${ZEPHYR_THRIFT_MODULE_DIR}/lib/cpp/src
|
|
)
|
|
|
|
zephyr_library_sources(
|
|
src/thrift/server/TFDServer.cpp
|
|
${ZEPHYR_THRIFT_MODULE_DIR}/lib/cpp/src/thrift/protocol/TProtocol.cpp
|
|
${ZEPHYR_THRIFT_MODULE_DIR}/lib/cpp/src/thrift/server/TConnectedClient.cpp
|
|
${ZEPHYR_THRIFT_MODULE_DIR}/lib/cpp/src/thrift/server/TSimpleServer.cpp
|
|
${ZEPHYR_THRIFT_MODULE_DIR}/lib/cpp/src/thrift/transport/SocketCommon.cpp
|
|
${ZEPHYR_THRIFT_MODULE_DIR}/lib/cpp/src/thrift/transport/TBufferTransports.cpp
|
|
${ZEPHYR_THRIFT_MODULE_DIR}/lib/cpp/src/thrift/transport/TFDTransport.cpp
|
|
${ZEPHYR_THRIFT_MODULE_DIR}/lib/cpp/src/thrift/transport/TTransportException.cpp
|
|
${ZEPHYR_THRIFT_MODULE_DIR}/lib/cpp/src/thrift/transport/TServerSocket.cpp
|
|
${ZEPHYR_THRIFT_MODULE_DIR}/lib/cpp/src/thrift/transport/TSocket.cpp
|
|
${ZEPHYR_THRIFT_MODULE_DIR}/lib/cpp/src/thrift/TApplicationException.cpp
|
|
${ZEPHYR_THRIFT_MODULE_DIR}/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)
|
|
|
|
# needed for ctime_r
|
|
zephyr_library_compile_definitions(_POSIX_C_SOURCE=200809L)
|
|
|
|
endif(CONFIG_THRIFT)
|