Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/eclipse-ecal/ecal into fe…
Browse files Browse the repository at this point in the history
…ature/gh_action_cleanup
  • Loading branch information
FlorianReimold committed May 7, 2024
2 parents c0dc9be + e78be41 commit 9f89612
Show file tree
Hide file tree
Showing 36 changed files with 865 additions and 332 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,6 @@ jobs:
run: cmake --build . --config Release
working-directory: ${{ runner.workspace }}/_build

- name: Build Python Wheel
run: cmake --build . --target create_python_wheel --config Release
working-directory: ${{ runner.workspace }}/_build

# - name: Build Documentation C
# run: cmake --build . --target documentation_c
# working-directory: ${{ runner.workspace }}/_build
Expand All @@ -125,9 +121,3 @@ jobs:
with:
name: macos-dmg
path: ${{ runner.workspace }}/_build/_deploy/*.dmg

- name: Upload Python Wheel
uses: actions/upload-artifact@v4
with:
name: macos-python-wheel
path: ${{ runner.workspace }}/_build/_deploy/*.whl
2 changes: 1 addition & 1 deletion .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
-DBUILD_APPS=ON ^
-DBUILD_SAMPLES=ON ^
-DBUILD_TIME=ON ^
-DBUILD_PY_BINDING=ON ^
-DBUILD_PY_BINDING=OFF ^
-DBUILD_CSHARP_BINDING=ON ^
-DBUILD_ECAL_TESTS=ON ^
-DECAL_INCLUDE_PY_SAMPLES=OFF ^
Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Build Wheels

on:
pull_request:
branches:
- master
release:
types: [published]
workflow_dispatch:


jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
fetch-depth: 0

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS: auto64

- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

build_arm64_wheels:
# Emulation takes a long time so we save it for release/manual triggering
name: Build arm64 wheels via emulation
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}

steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
fetch-depth: 0

- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: arm64

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS_LINUX: aarch64

- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-arm64
path: ./wheelhouse/*.whl

6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ Thumbs.db
/_vs_out*
/out

# Python building and distribution
/_python_build/
/dist/
/lang/python/core/ecal/_version.py
/wheelhouse/

# Binary libraries
/thirdparty/npcap/

Expand Down
19 changes: 15 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ option(BUILD_APPS "Build the eCAL applications"
option(BUILD_SAMPLES "Build the eCAL samples" ON)
option(BUILD_TIME "Build the eCAL time interfaces" ON)
option(BUILD_PY_BINDING "Build eCAL python binding" OFF)
option(BUILD_STANDALONE_PY_WHEEL "Build eCAL python binding as standalone wheel" OFF)
option(BUILD_CSHARP_BINDING "Build eCAL C# binding" OFF)
option(BUILD_ECAL_TESTS "Build the eCAL google tests" OFF)

Expand Down Expand Up @@ -125,7 +124,18 @@ option(CPACK_PACK_WITH_INNOSETUP "Create Innosetup installer for t

set(ECAL_INSTALL_PYTHON_DIR "bin" CACHE PATH "Location to install the Python extension modules. Might be set by setupdtools install.")

set(ECAL_BUILD_VERSION "0.0.0" CACHE STRING "Inject a build version if not building from a git repository")
if(DEFINED SKBUILD_PROJECT_VERSION)
message(STATUS
"Using version from scikit-build-core: ${SKBUILD_PROJECT_VERSION}"
)
set(ECAL_BUILD_VERSION "${SKBUILD_PROJECT_VERSION}" CACHE STRING
"Version provided by scikit-build-core and setuptools-scm" FORCE
)
else()
set(ECAL_BUILD_VERSION "0.0.0" CACHE STRING
"Inject a build version if not building from a git repository"
)
endif()

set(ECAL_CSHARP_BUILD_SAMPLES ${BUILD_SAMPLES})

Expand Down Expand Up @@ -172,10 +182,12 @@ set(eCAL_VERSION_PATCH ${GIT_REVISION_PATCH})
set(eCAL_VERSION_STRING ${eCAL_VERSION_MAJOR}.${eCAL_VERSION_MINOR}.${eCAL_VERSION_PATCH})
set(eCAL_VERSION ${eCAL_VERSION_STRING})

message(STATUS "eCAL version: ${eCAL_VERSION_STRING}")
message(DEBUG "eCAL git describe tag: ${GIT_DESCRIBE_TAG}")

include(helper_functions/ecal_add_functions)
include(helper_functions/ecal_helper_functions)
include(helper_functions/ecal_install_functions)
include(helper_functions/ecal_python_functions)

if(MSVC)
set(eCAL_PLATFORM_TOOLSET ${CMAKE_VS_PLATFORM_TOOLSET})
Expand Down Expand Up @@ -465,7 +477,6 @@ message(STATUS "BUILD_APPS : ${BUILD_APPS}")
message(STATUS "BUILD_SAMPLES : ${BUILD_SAMPLES}")
message(STATUS "BUILD_TIME : ${BUILD_TIME}")
message(STATUS "BUILD_PY_BINDING : ${BUILD_PY_BINDING}")
message(STATUS "BUILD_STANDALONE_PY_WHEEL : ${BUILD_STANDALONE_PY_WHEEL}")
message(STATUS "BUILD_CSHARP_BINDING : ${BUILD_CSHARP_BINDING}")
message(STATUS "BUILD_ECAL_TESTS : ${BUILD_ECAL_TESTS}")
message(STATUS "ECAL_INCLUDE_PY_SAMPLES : ${ECAL_INCLUDE_PY_SAMPLES}")
Expand Down
23 changes: 12 additions & 11 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,20 @@
}
},
{
"name": "wheel",
"name": "python",
"inherits": "core",
"displayName": "Python Wheel",
"description": "Minimal build for standalone python wheel",
"displayName": "Python Extensions",
"description": "Minimal build for Python extensions",
"cacheVariables": {
"HAS_HDF5": "ON",
"BUILD_PY_BINDING": "ON",
"BUILD_STANDALONE_PY_WHEEL": "ON",
"ECAL_THIRDPARTY_BUILD_HDF5": null
"BUILD_SHARED": "OFF",
"ECAL_THIRDPARTY_BUILD_HDF5": "ON"
}
},
{
"name": "docs",
"inherits": "wheel",
"inherits": "python",
"displayName": "Documentation",
"description": "Build documentation",
"cacheVariables": {
Expand All @@ -92,6 +92,7 @@
"HAS_CURL": "ON",
"HAS_FTXUI": "ON",
"BUILD_APPS": "ON",
"BUILD_SAMPLES": "ON",
"ECAL_THIRDPARTY_BUILD_FINEFTP": "ON",
"ECAL_THIRDPARTY_BUILD_FTXUI": "ON",
"ECAL_THIRDPARTY_BUILD_SPDLOG": "ON",
Expand Down Expand Up @@ -119,16 +120,16 @@
"configurePreset": "core"
},
{
"name": "wheel",
"description": "Build standalone python wheel",
"configurePreset": "wheel",
"targets": "create_python_wheel"
"name": "python",
"description": "Build python extensions",
"configurePreset": "python",
"targets": "ecal_python"
},
{
"name": "docs",
"description": "Build sphinx documentation",
"configurePreset": "docs",
"targets": "documentation_sphinx"
"targets": "documentation_sphinx"
},
{
"name": "cli",
Expand Down
6 changes: 0 additions & 6 deletions app/app_pb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,4 @@ target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_14)

ecal_install_library(${PROJECT_NAME})

if(BUILD_PY_BINDING)
protobuf_generate_python_ext(python_sources ${PYTHON_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src ${ProtoFiles})
target_sources(${PROJECT_NAME} PRIVATE ${python_sources})
set_source_files_properties(${python_sources} PROPERTIES HEADER_FILE_ONLY TRUE)
endif()

set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER app/app_pb)
112 changes: 0 additions & 112 deletions cmake/helper_functions/ecal_python_functions.cmake

This file was deleted.

6 changes: 0 additions & 6 deletions contrib/ecaltime/ecaltime_pb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,4 @@ target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_14)

ecal_install_library(${PROJECT_NAME})

if(BUILD_PY_BINDING)
protobuf_generate_python_ext(python_sources ${PYTHON_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src ${ProtoFiles})
target_sources(${PROJECT_NAME} PRIVATE ${python_sources})
set_source_files_properties(${python_sources} PROPERTIES HEADER_FILE_ONLY TRUE)
endif()

set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER contrib/ecaltime/ecaltime_pb)
6 changes: 0 additions & 6 deletions ecal/core_pb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,4 @@ target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_14)

ecal_install_library(${PROJECT_NAME})

if(BUILD_PY_BINDING)
protobuf_generate_python_ext(python_sources ${PYTHON_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src ${ProtoFiles})
target_sources(${PROJECT_NAME} PRIVATE ${python_sources})
set_source_files_properties(${python_sources} PROPERTIES HEADER_FILE_ONLY TRUE)
endif()

set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER core)
12 changes: 12 additions & 0 deletions ecal/service/ecal_service/src/server_session_impl_v0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,18 @@ namespace eCAL
// Data receiving and sending
///////////////////////////////////////////////
void ServerSessionV0::start()
{
// Call the handle_start with the io_service
// It is important to async call handle_start(), as it will call a
// user-defined callback. As we have no influence what that callback will
// be, we must call it from another thread to make sure to not double-lock
// mutexes from the server_impl, if the callback should itself call a
// server_impl api function.

io_context_->post([me = shared_from_this()]() { me->handle_start(); });
}

void ServerSessionV0::handle_start()
{
// Go to handshake state
state_ = State::CONNECTED;
Expand Down
5 changes: 5 additions & 0 deletions ecal/service/ecal_service/src/server_session_impl_v0.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ namespace eCAL
///////////////////////////////////////////////
public:
void start() override;

private:
void handle_start();

public:
void stop() override;

eCAL::service::State get_state() const override;
Expand Down
Loading

0 comments on commit 9f89612

Please sign in to comment.