-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added macos support for libcyphal_demo - UDP only transport. #36
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
bc45ce1
added macos support
serges147 14aead5
fixed incorrect kqueue executor implementation
serges147 86cb183
silence `EINTR` "error" condition
serges147 f4caf23
minor cmake fixes
serges147 74d091f
Cherry-pick of 54cee7d2 by Scott Dixon,
thirtytwobits b7c5fc1
try fix CI
serges147 b35f528
try fix CI
serges147 5b5de86
try fix CI
serges147 656ce3c
revert back to Nunavut 3.0.preview
serges147 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,24 +18,23 @@ jobs: | |
build_libcyphal_demo: | ||
name: Build LibCyphal demo | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
build_type: [Release, Debug] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: get nunavut | ||
run: > | ||
pip install git+https://github.com/OpenCyphal/[email protected] | ||
- name: Install Ninja | ||
run: sudo apt-get install ninja-build | ||
|
||
- name: Configure CMake | ||
run: cmake -B ${{github.workspace}}/libcyphal_demo/build -DCMAKE_BUILD_TYPE=${{matrix.build_type}} ${{github.workspace}}/libcyphal_demo | ||
run: cd ${{github.workspace}}/libcyphal_demo && cmake --preset Demo-Linux | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
- name: Build | ||
run: cmake --build ${{github.workspace}}/libcyphal_demo/build --config ${{matrix.build_type}} | ||
- name: Build Debug | ||
run: cd ${{github.workspace}}/libcyphal_demo && cmake --build --preset Demo-Linux-Debug | ||
|
||
- name: Build Release | ||
run: cd ${{github.workspace}}/libcyphal_demo && cmake --build --preset Demo-Linux-Release | ||
|
||
build_libudpard_demo: | ||
name: Build LibUDPard demo | ||
|
@@ -46,10 +45,6 @@ jobs: | |
with: | ||
submodules: recursive | ||
|
||
- name: get nunavut | ||
run: > | ||
pip install git+https://github.com/OpenCyphal/[email protected] | ||
|
||
- name: Configure CMake | ||
run: cmake -B ${{github.workspace}}/libudpard_demo/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{github.workspace}}/libudpard_demo | ||
|
||
|
@@ -65,10 +60,6 @@ jobs: | |
with: | ||
submodules: recursive | ||
|
||
- name: get nunavut | ||
run: > | ||
pip install git+https://github.com/OpenCyphal/[email protected] | ||
|
||
- name: Configure CMake | ||
run: cmake -B ${{github.workspace}}/differential_pressure_sensor/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{github.workspace}}/differential_pressure_sensor | ||
|
||
|
@@ -85,10 +76,6 @@ jobs: | |
with: | ||
submodules: recursive | ||
|
||
- name: get nunavut | ||
run: > | ||
pip install git+https://github.com/OpenCyphal/[email protected] | ||
|
||
- name: Configure CMake | ||
run: cmake -B ${{github.workspace}}/udral_servo/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{github.workspace}}/udral_servo | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,10 @@ | |
# Author: Pavel Kirienko <[email protected]> | ||
|
||
cmake_minimum_required(VERSION 3.17) | ||
project(differential_pressure_sensor C CXX) | ||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules") | ||
project(differential_pressure_sensor C) | ||
|
||
set(submodules "${CMAKE_SOURCE_DIR}/../submodules") | ||
set(submodules "${CMAKE_CURRENT_SOURCE_DIR}/../submodules") | ||
set(CMAKE_PREFIX_PATH "${submodules}/nunavut") | ||
|
||
set(CMAKE_C_STANDARD 11) | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror -pedantic -fstrict-aliasing") | ||
|
@@ -17,7 +17,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wsign-conversion -Wcast-align -Wmissing-dec | |
# Forward the revision information to the compiler so that we could expose it at runtime. This is entirely optional. | ||
execute_process( | ||
COMMAND git rev-parse --short=16 HEAD | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
OUTPUT_VARIABLE vcs_revision_id | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
|
@@ -29,39 +29,32 @@ add_definitions( | |
-DNODE_NAME="org.opencyphal.demos.differential_pressure" | ||
) | ||
|
||
# Transpile DSDL into C using Nunavut. Install Nunavut as follows: pip install nunavut. | ||
# Alternatively, you can invoke the transpiler manually or use https://nunaweb.opencyphal.org. | ||
find_package(nnvg REQUIRED) | ||
create_dsdl_target( # Generate the support library for generated C headers, which is "nunavut.h". | ||
"nunavut_support" | ||
c | ||
${CMAKE_BINARY_DIR}/transpiled | ||
"" | ||
OFF | ||
little | ||
"only" | ||
## Transpile DSDL into C using Nunavut. This uses this repo's built-in submodules to setup Nunavut. See | ||
# CMAKE_PREFIX_PATH above for how this is resolved to the local submodules. | ||
find_package(Nunavut 3.0 REQUIRED) | ||
|
||
set(LOCAL_PUBLIC_TYPES | ||
uavcan/node/430.GetInfo.1.0.dsdl | ||
uavcan/node/435.ExecuteCommand.1.1.dsdl | ||
uavcan/node/7509.Heartbeat.1.0.dsdl | ||
uavcan/node/port/7510.List.0.1.dsdl | ||
uavcan/pnp/8165.NodeIDAllocationData.2.0.dsdl | ||
uavcan/register/384.Access.1.0.dsdl | ||
uavcan/register/385.List.1.0.dsdl | ||
uavcan/si/unit/pressure/Scalar.1.0.dsdl | ||
uavcan/si/unit/temperature/Scalar.1.0.dsdl | ||
) | ||
set(dsdl_root_namespace_dirs # List all DSDL root namespaces to transpile here. | ||
${submodules}/public_regulated_data_types/uavcan | ||
${submodules}/public_regulated_data_types/reg | ||
|
||
add_cyphal_library( | ||
NAME dsdl_uavcan | ||
EXACT_NAME | ||
LANGUAGE c | ||
LANGUAGE_STANDARD c${CMAKE_C_STANDARD} | ||
DSDL_FILES ${LOCAL_PUBLIC_TYPES} | ||
SERIALIZATION_ASSERT assert | ||
EXPORT_MANIFEST | ||
OUT_LIBRARY_TARGET LOCAL_TYPES_C_LIBRARY | ||
) | ||
foreach (ns_dir ${dsdl_root_namespace_dirs}) | ||
get_filename_component(ns ${ns_dir} NAME) | ||
message(STATUS "DSDL namespace ${ns} at ${ns_dir}") | ||
create_dsdl_target( | ||
"dsdl_${ns}" # CMake target name | ||
c # Target language to transpile into | ||
${CMAKE_BINARY_DIR}/transpiled # Destination directory (add it to the includes) | ||
${ns_dir} # Source directory | ||
OFF # Disable variable array capacity override | ||
little # Endianness of the target platform (alternatives: "big", "any") | ||
"never" # Support files are generated once in the nunavut_support target (above) | ||
${dsdl_root_namespace_dirs} # Look-up DSDL namespaces | ||
) | ||
add_dependencies("dsdl_${ns}" nunavut_support) | ||
endforeach () | ||
include_directories(SYSTEM ${CMAKE_BINARY_DIR}/transpiled) # Make the transpiled headers available for inclusion. | ||
add_definitions(-DNUNAVUT_ASSERT=assert) | ||
|
||
# Build libcanard. | ||
add_library(canard STATIC ${submodules}/libcanard/libcanard/canard.c) | ||
|
@@ -71,12 +64,21 @@ include_directories(SYSTEM ${submodules}/libcanard/libcanard) | |
add_library(o1heap STATIC ${submodules}/o1heap/o1heap/o1heap.c) | ||
include_directories(SYSTEM ${submodules}/o1heap/o1heap/) | ||
|
||
include(${CMAKE_SOURCE_DIR}/../shared/register/register.cmake) | ||
include(${CMAKE_SOURCE_DIR}/../shared/socketcan/socketcan.cmake) | ||
include(${CMAKE_CURRENT_SOURCE_DIR}/../shared/register/register.cmake) | ||
target_link_libraries(shared_register | ||
PRIVATE ${LOCAL_TYPES_C_LIBRARY} | ||
) | ||
|
||
include(${CMAKE_CURRENT_SOURCE_DIR}/../shared/socketcan/socketcan.cmake) | ||
|
||
# Build the application. | ||
add_executable(differential_pressure_sensor | ||
src/main.c | ||
) | ||
add_dependencies(differential_pressure_sensor dsdl_uavcan dsdl_reg) | ||
target_link_libraries(differential_pressure_sensor canard o1heap shared_register shared_socketcan) | ||
target_link_libraries(differential_pressure_sensor | ||
${LOCAL_TYPES_C_LIBRARY} | ||
canard | ||
o1heap | ||
shared_register | ||
shared_socketcan | ||
) |
113 changes: 0 additions & 113 deletions
113
differential_pressure_sensor/cmake/modules/Findnnvg.cmake
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we just use the toolshed container?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try in the separate pr.
#37