Skip to content

Commit

Permalink
Merge remote-tracking branch 'zsl/build-packages-cpack' into build-pa…
Browse files Browse the repository at this point in the history
…ckages-cpack
  • Loading branch information
milyin committed Oct 25, 2024
2 parents 3229ce4 + 5e627e3 commit 0bb3650
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ linker = "arm-linux-gnueabihf-gcc"
linker = "arm-linux-gnueabi-gcc"

[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"
linker = "armv7-linux-gnueabihf-gcc"

[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
Expand Down
24 changes: 10 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ jobs:
- { target: x86_64-unknown-linux-musl, os: ubuntu-20.04 }
- { target: arm-unknown-linux-gnueabi, os: ubuntu-20.04 }
- { target: arm-unknown-linux-gnueabihf, os: ubuntu-20.04 }
- { target: armv7-unknown-linux-gnueabihf, os: ubuntu-20.04 }
- { target: armv7-unknown-linux-gnueabihf, os: macos-12 }
- { target: aarch64-unknown-linux-gnu, os: ubuntu-20.04 }
- { target: aarch64-unknown-linux-musl, os: ubuntu-20.04 }
- { target: x86_64-apple-darwin, os: macos-12 }
- { target: aarch64-apple-darwin, os: macos-12 }
- { target: x86_64-pc-windows-msvc, os: windows-2019 }
- { target: x86_64-pc-windows-gnu, os: windows-2019 }
- { target: x86_64-pc-windows-gnu, os: ubuntu-20.04 }
needs: tag
steps:
- name: Checkout this repository
Expand All @@ -115,7 +115,7 @@ jobs:

- name: Install build deps
if: ${{ matrix.build.target == 'armv7-unknown-linux-gnueabihf'}}
run: sudo apt-get install -y gcc-arm-linux-gnueabihf libc6-armhf-cross libc6-dev-armhf-cross
run: brew install -f messense/macos-cross-toolchains/armv7-unknown-linux-gnueabihf

- name: Install build deps
if: ${{ matrix.build.target == 'aarch64-unknown-linux-gnu'}}
Expand All @@ -126,23 +126,19 @@ jobs:
run: |
wget https://musl.cc/aarch64-linux-musl-cross.tgz
tar xvfz aarch64-linux-musl-cross.tgz
echo "$(readlink -f aarch64-linux-musl-cross)/bin" >> "$GITHUB_PATH"
- name: Install build deps
if: ${{ matrix.build.target == 'x86_64-pc-windows-gnu'}}
run: |
sudo apt-get install -y mingw-w64
- id: build
shell: bash
run: |
toolchain_file=$(readlink -f TC-${{ matrix.build.target }}.cmake)
cmake_cmd="cmake .. -DZENOHC_CUSTOM_TARGET=${{ matrix.build.target }} -DCMAKE_TOOLCHAIN_FILE="${toolchain_file}" -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DZENOHC_BUILD_WITH_UNSTABLE_API=ON -DZENOHC_BUILD_WITH_SHARED_MEMORY=ON"
if [[ "${{ matrix.build.target }}" == "aarch64-unknown-linux-musl" ]]; then
export PATH=$PATH:$(readlink -f aarch64-linux-musl-cross)/bin
elif [[ "${{ matrix.build.target }}" == "x86_64-pc-windows-gnu" ]]; then
export PATH=/c/mingw64/bin:$PATH
echo $PATH
c_compiler="/c/mingw64/bin/x86_64-w64-mingw32-gcc.exe"
cxx_compiler="/c/mingw64/bin/x86_64-w64-mingw32-g++.exe"
cmake_cmd="cmake .. -DZENOHC_CUSTOM_TARGET=${{ matrix.build.target }} -DCMAKE_C_COMPILER="${c_compiler}" -DCMAKE_CXX_COMPILER_TARGET="${cxx_compiler}" -DCMAKE_TOOLCHAIN_FILE="${toolchain_file}" -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DZENOHC_BUILD_WITH_UNSTABLE_API=ON -DZENOHC_BUILD_WITH_SHARED_MEMORY=ON"
fi
mkdir -p build && cd build
$cmake_cmd
cmake .. -DZENOHC_CUSTOM_TARGET=${{ matrix.build.target }} -DCMAKE_TOOLCHAIN_FILE="${toolchain_file}" -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DZENOHC_BUILD_WITH_UNSTABLE_API=ON -DZENOHC_BUILD_WITH_SHARED_MEMORY=ON
cmake --build . --config Release
cpack -C Release -G ZIP
Expand Down
2 changes: 1 addition & 1 deletion TC-armv7-unknown-linux-gnueabihf.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR armv7)
set(ZENOHC_CUSTOM_TARGET armv7-unknown-linux-gnueabihf)
set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
set(CMAKE_C_COMPILER armv7-linux-gnueabihf-gcc)

0 comments on commit 0bb3650

Please sign in to comment.