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 24, 2024
2 parents 31257f2 + 3669fe8 commit a0d2369
Show file tree
Hide file tree
Showing 16 changed files with 64 additions and 9 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.arm7-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
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ jobs:
export PATH=$(PWD)/aarch64-linux-musl-cross/bin/:$PATH
fi
mkdir -p build && cd build
cmake .. -DZENOHC_CUSTOM_TARGET=${{ matrix.build.target }} -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DZENOHC_BUILD_WITH_UNSTABLE_API=ON -DZENOHC_BUILD_WITH_SHARED_MEMORY=ON
cmake .. -DZENOHC_CUSTOM_TARGET=${{ matrix.build.target }} -DCMAKE_TOOLCHAIN_FILE=../${{ matrix.build.target }}.cmake -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
12 changes: 10 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,17 @@ set_lib(dylibsd dylibd ${CMAKE_SHARED_LIBRARY_PREFIX}zenohcd${CMAKE_SHARED_LIBRA
set_lib(staticlibsr staticlibr ${CMAKE_STATIC_LIBRARY_PREFIX}zenohc${CMAKE_STATIC_LIBRARY_SUFFIX})
set_lib(staticlibsd staticlibd ${CMAKE_STATIC_LIBRARY_PREFIX}zenohcd${CMAKE_STATIC_LIBRARY_SUFFIX})
if(WIN32)
set_lib(dylibsr implibr ${CMAKE_IMPORT_LIBRARY_PREFIX}zenohc${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_IMPORT_LIBRARY_SUFFIX})
set_lib(dylibsd implibd ${CMAKE_IMPORT_LIBRARY_PREFIX}zenohcd${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_IMPORT_LIBRARY_SUFFIX})
if (MINGW)
set_lib(dylibsr dylibr zenohc${CMAKE_SHARED_LIBRARY_SUFFIX})
set_lib(dylibsd dylibd zenohcd${CMAKE_SHARED_LIBRARY_SUFFIX})
set_lib(dylibsr implibr ${CMAKE_STATIC_LIBRARY_PREFIX}zenohc${CMAKE_IMPORT_LIBRARY_SUFFIX})
set_lib(dylibsd implibd ${CMAKE_STATIC_LIBRARY_PREFIX}zenohcd${CMAKE_IMPORT_LIBRARY_SUFFIX})
elseif(MSVC)
set_lib(dylibsr implibr ${CMAKE_STATIC_LIBRARY_PREFIX}zenohc${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_IMPORT_LIBRARY_SUFFIX})
set_lib(dylibsd implibd ${CMAKE_STATIC_LIBRARY_PREFIX}zenohcd${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_IMPORT_LIBRARY_SUFFIX})
endif()
endif()

list(APPEND libsr ${dylibsr})
list(APPEND libsr ${staticlibsr})
list(APPEND libsd ${dylibsd})
Expand Down
3 changes: 3 additions & 0 deletions TC-aarch64-apple-darwin.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
set(CMAKE_SYSTEM_NAME Darwin)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(ZENOHC_CUSTOM_TARGET aarch64-apple-darwin)
5 changes: 5 additions & 0 deletions TC-aarch64-unknown-linux-gnu.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(ZENOHC_CUSTOM_TARGET aarch64-unknown-linux-gnu)
set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER_TARGET aarch64-linux-gnu-g++)
5 changes: 5 additions & 0 deletions TC-aarch64-unknown-linux-musl.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(ZENOHC_CUSTOM_TARGET aarch64-unknown-linux-musl)
set(CMAKE_C_COMPILER aarch64-linux-musl-gcc)
set(CMAKE_CXX_COMPILER_TARGET aarch64-linux-musl-g++)
5 changes: 5 additions & 0 deletions TC-arm-unknown-linux-gnueabi.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(ZENOHC_CUSTOM_TARGET arm-unknown-linux-gnueabi)
set(CMAKE_C_COMPILER arm-linux-gnueabi-gcc)
set(CMAKE_CXX_COMPILER arm-linux-gnueabi-g++)
5 changes: 5 additions & 0 deletions TC-arm-unknown-linux-gnueabihf.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR armhf)
set(ZENOHC_CUSTOM_TARGET arm-unknown-linux-gnueabihf)
set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++)
5 changes: 5 additions & 0 deletions TC-armv7-unknown-linux-gnueabihf.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR armv7)
set(ZENOHC_CUSTOM_TARGET armv7-unknown-linux-gnueabihf)
set(CMAKE_C_COMPILER armv7-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER armv7-linux-gnueabihf-g++)
3 changes: 3 additions & 0 deletions TC-x86_64-apple-darwin.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
set(CMAKE_SYSTEM_NAME Darwin)
set(CMAKE_SYSTEM_PROCESSOR x86_64)
set(ZENOHC_CUSTOM_TARGET x86_64-apple-darwin)
5 changes: 5 additions & 0 deletions TC-x86_64-pc-windows-gnu.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR x86_64)
set(ZENOHC_CUSTOM_TARGET x86_64-pc-windows-gnu)
set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
set(CMAKE_CXX_COMPILER_TARGET x86_64-w64-mingw32-g++)
3 changes: 3 additions & 0 deletions TC-x86_64-pc-windows-msvc.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR x86_64)
set(ZENOHC_CUSTOM_TARGET x86_64-pc-windows-msvc)
5 changes: 5 additions & 0 deletions TC-x86_64-unknown-linux-gnu.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR x86_64)
set(ZENOHC_CUSTOM_TARGET x86_64-unknown-linux-gnu)
set(CMAKE_C_COMPILER x86_64-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER x86_64-linux-gnu-g++)
5 changes: 5 additions & 0 deletions TC-x86_64-unknown-linux-musl.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR x86_64)
set(ZENOHC_CUSTOM_TARGET x86_64-unknown-linux-musl)
set(CMAKE_C_COMPILER x86_64-linux-musl-gcc)
set(CMAKE_CXX_COMPILER_TARGET x86_64-linux-musl-g++)
4 changes: 3 additions & 1 deletion install/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ if(NOT CPACK_PACKAGE_VERSION)
endif()
endif()

set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")

set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
set(CPACK_PROJECT_CONFIG_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cpack_project_config.cmake")

include(CPack)
4 changes: 0 additions & 4 deletions install/cpack_project_config.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
if(CPACK_GENERATOR MATCHES "DEB")
# DEB package
if(NOT DEBARCH)
set(DEBARCH ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
endif()
message(STATUS "Configure DEB packaging for Linux ${DEBARCH}")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "ZettaScale Zenoh Team, <[email protected]>")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${DEBARCH})
set(CPACK_DEB_COMPONENT_INSTALL ON)
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
set(CPACK_DEBIAN_LIB_PACKAGE_NAME lib${CPACK_PACKAGE_NAME})
Expand Down

0 comments on commit a0d2369

Please sign in to comment.