Skip to content

Commit

Permalink
Enable symbol mangling on macOS and Windows (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmartin82 authored Dec 12, 2024
1 parent cd79443 commit b89482a
Show file tree
Hide file tree
Showing 11 changed files with 459 additions and 197 deletions.
33 changes: 27 additions & 6 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,30 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-11, macos-ventura, [ubuntu-22.04, ARM64]]
runs-on: [self-hosted, "${{ matrix.os }}"]
os-arch:
- { os: "ubuntu-latest", arch: "X64" }
- { os: "windows-11", arch: "X64" }
- { os: "macos-ventura", arch: "ARM64" }
- { os: "ubuntu-22.04", arch: "ARM64" }
runs-on: ["${{ matrix.os-arch.os }}", "${{ matrix.os-arch.arch }}"]

steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install ACL
if: startsWith(matrix.os,'ubuntu')
if: startsWith(matrix.os-arch.os,'ubuntu')
run: sudo apt-get -y install acl-dev
- name: Install LLVM toolchain
if: startsWith(matrix.os-arch.os,'macos')
run: |
brew install llvm@19
ls /opt/homebrew/opt/llvm@19/bin
echo "/opt/homebrew/opt/llvm@19/bin" >> $GITHUB_PATH
- name: Install Rust toolchain
run: |
rustup show
rustup component add rustfmt clippy
- name: Code format check
uses: actions-rs/cargo@v1
with:
Expand All @@ -34,10 +48,17 @@ jobs:
with:
command: clippy
args: -- -D warnings
- name: Build (without Iceoryx)
- name: Build (default features)
run: cargo build --verbose
- name: Build (with Iceoryx)
if: ${{ ! startsWith(matrix.os,'window') }}
if: ${{ ! startsWith(matrix.os-arch.os,'window') }}
run: cargo build --features iceoryx --verbose
- name: Run tests (without Iceoryx)
- name: Build (with symbol prefixing)
run: cargo build --features prefix_symbols --verbose
- name: Run tests (default features)
run: cargo test --verbose
- name: Run tests (with Iceoryx)
if: ${{ ! startsWith(matrix.os-arch.os,'window') }}
run: cargo test --features iceoryx --verbose
- name: Run tests (with symbol prefixing)
run: cargo test --features prefix_symbols --verbose
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cyclors"
version = "0.3.3"
version = "0.3.4"
authors = ["kydos <[email protected]>"]
license = "Apache-2.0"
readme = "README.md"
Expand Down Expand Up @@ -30,3 +30,4 @@ cmake = "0.1"

[features]
iceoryx = []
prefix_symbols = []
17 changes: 17 additions & 0 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[target.x86_64-unknown-linux-musl]
image = "jenoch/rust-cross:x86_64-unknown-linux-musl"

[target.arm-unknown-linux-gnueabi]
image = "jenoch/rust-cross:arm-unknown-linux-gnueabi"

[target.arm-unknown-linux-gnueabihf]
image = "jenoch/rust-cross:arm-unknown-linux-gnueabihf"

[target.armv7-unknown-linux-gnueabihf]
image = "jenoch/rust-cross:armv7-unknown-linux-gnueabihf"

[target.aarch64-unknown-linux-gnu]
image = "jenoch/rust-cross:aarch64-unknown-linux-gnu"

[target.aarch64-unknown-linux-musl]
image = "jenoch/rust-cross:aarch64-unknown-linux-musl"
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# cyclors
Low level RUST APIs for cyclone

## Supported Features

* ```iceoryx```: Enable support for the Iceoryx PSMX plugin in Cyclone DDS (Linux and macOS only).
* ```prefix_symbols```: Prefix the symbols in the Cyclone DDS and Cyclocut libraries with the version of the cyclors crate. This allows for different versions of the crate to be loaded together statically. On macOS and Windows platforms ```llvm-nm``` and ```llvm-objcopy``` are required.

**Note:** The ```iceoryx``` and ```prefix_symbols``` features are optional and cannot be enabled at the same time.
Loading

0 comments on commit b89482a

Please sign in to comment.