Skip to content

Commit

Permalink
add sample toolchains and fix library names
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisBiryukov91 committed Oct 24, 2024
1 parent aab2487 commit d9032ef
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ rustflags = "-Ctarget-feature=-crt-static"

[target.aarch64-unknown-linux-musl]
rustflags = "-Ctarget-feature=-crt-static"

[target.armv7-unknown-linux-gnueabihf]
linker = "armv7-linux-gnueabihf-gcc"
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
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++)
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++)
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-unknown-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER x86_64-unknown-linux-gnu-g++)
5 changes: 4 additions & 1 deletion install/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ install_zenohc_lib("Debug" "DEBUG" zenohc)
#
# Configure CPack
#
set(CPACK_BUILD_CONFIG ${CMAKE_BUILD_TYPE})
set(CPACK_PACKAGE_DIRECTORY "${CMAKE_BINARY_DIR}/packages")
set(CPACK_PACKAGE_CHECKSUM MD5)
set(CPACK_PACKAGE_VENDOR "The Eclipse Foundation")
Expand Down Expand Up @@ -123,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)
8 changes: 0 additions & 8 deletions install/cpack_project_config.cmake
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
if(CPACK_GENERATOR MATCHES "DEB")
# DEB package
if(NOT DEBARCH)
execute_process(
COMMAND dpkg --print-architecture
OUTPUT_VARIABLE DEBARCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
message(STATUS "Configure DEB packaging for Linux ${DEBARCH}")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "ZettaScale Zenoh Team, <zenoh@zettascale.tech>")
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 d9032ef

Please sign in to comment.