Merge branch 'master' of github.com:traintastic/traintastic

Dieser Commit ist enthalten in:
Reinder Feenstra 2022-04-23 20:19:47 +02:00
Commit 0157cf1b0f
5 geänderte Dateien mit 29 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -202,6 +202,18 @@ jobs:
defines: "-DDEBIAN_PACKAGE_VERSION_EXTRA=~raspberrypios~buster~$CI_REF_NAME_SLUG~${{github.run_number}}~$CI_SHA_SHORT -DDISABLE_CLANG_TIDY=ON"
ccov: false
- name: "macos-11"
os: "macos-11"
generator: "Unix Makefiles"
arch: ""
toolset: ""
target: all
jobs: 3
build_type: Release
build_deb: false
defines: "-DDISABLE_CLANG_TIDY=ON"
ccov: false
steps:
- uses: FranzDiebold/github-env-vars-action@v2
@ -225,6 +237,11 @@ jobs:
if: startswith(matrix.config.os, 'ubuntu')
run: sudo apt install liblua5.3-dev lcov libarchive-dev clang-tidy
# MacOS only:
- name: Install brew packages
if: startswith(matrix.config.os, 'macos')
run: brew install libarchive lua@5.3
# All:
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory

Datei anzeigen

@ -194,6 +194,9 @@ if(WIN32)
# copy archive.dll to build directory:
add_custom_command(TARGET traintastic-server POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "${PROJECT_SOURCE_DIR}/thirdparty/libarchive/bin/archive.dll" .)
elseif(APPLE)
set(LibArchive_INCLUDE_DIRS "/usr/local/opt/libarchive/include")
set(LibArchive_LIBRARIES "/usr/local/opt/libarchive/lib/libarchive.dylib")
else()
find_package(LibArchive REQUIRED)
endif()
@ -219,6 +222,9 @@ if(ENABLE_LUA_SCRIPTING)
# copy lua53.dll to build directory, to be able to run the tests:
add_custom_command(TARGET traintastic-server-test POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "${PROJECT_SOURCE_DIR}/thirdparty/lua5.3/bin/win64/lua53.dll" .)
elseif(APPLE)
set(LUA_INCLUDE_DIR "/usr/local/opt/lua@5.3/include/lua")
set(LUA_LIBRARIES "/usr/local/opt/lua@5.3/lib/liblua5.3.dylib")
else()
find_package(Lua 5.3 REQUIRED)
endif()

Datei anzeigen

@ -24,6 +24,7 @@
#define TRAINTASTIC_SERVER_HARDWARE_PROTOCOL_ECOS_KERNEL_HPP
#include <thread>
#include <unordered_map>
#include <boost/asio/io_context.hpp>
#include <traintastic/enum/tristate.hpp>
#include <traintastic/enum/decoderprotocol.hpp>

Datei anzeigen

@ -24,6 +24,7 @@
#define TRAINTASTIC_SERVER_HARDWARE_PROTOCOL_LOCONET_KERNEL_HPP
#include <array>
#include <unordered_map>
#include <thread>
#include <boost/asio/io_context.hpp>
#include <boost/asio/steady_timer.hpp>

Datei anzeigen

@ -33,7 +33,11 @@ inline void setThreadName(const char* name)
{
#if __has_include(<pthread.h>)
if constexpr(std::is_same_v<std::thread::native_handle_type, pthread_t>)
#ifdef __APPLE__
pthread_setname_np(name);
#else
pthread_setname_np(pthread_self(), name);
#endif
#endif
#ifdef WIN32
// TODO: