Skip to content

Commit

Permalink
iox-eclipse-iceoryx#736 Add patch for cyclonedds-cxx
Browse files Browse the repository at this point in the history
  • Loading branch information
dkroenke committed Jul 5, 2021
1 parent d20eea6 commit a4ba5f9
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 14 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Fix warnings for gcc-11.1[\#838](https://github.com/eclipse-iceoryx/iceoryx/issues/838)
- Incremental builds with the build script are broken[\#821](https://github.com/eclipse-iceoryx/iceoryx/issues/821)
- Compile failed because of missing <limits> for GCC 11[\#811](https://github.com/eclipse-iceoryx/iceoryx/issues/811) thanks to @homalozoa
- Unable to build cyclone dds idlpp-cxx [\#736](https://github.com/eclipse-iceoryx/iceoryx/issues/736)

**Refactoring:**

Expand All @@ -32,6 +33,8 @@

**API Breaking Changes:**

Dependency for building the iceoryx_dds gateway changed from `openjdk` (Java) to `bison`

Rename utils to hoofs:

- in CMake you need now to find and link the package `iceoryx_hoofs` instead of `iceoryx_utils`
Expand Down
4 changes: 2 additions & 2 deletions NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ cpptoml library (v0.1.1)
* Usage: as-is, static-linking
* enabled by default build

Eclipse Cyclone DDS (Branch idlcxx)
Eclipse Cyclone DDS (Branch master)
* License: Eclipse Public License v. 2.0 or the Eclipse Distribution License v. 1.0
* Project: https://github.com/eclipse-cyclonedds/cyclonedds
* Source: https://github.com/eclipse-cyclonedds/cyclonedds/tree/idlcxx
* Usage: as-is, static-linking

C++ binding for Eclipse Cyclone DDS (Branch idlcxx)
C++ binding for Eclipse Cyclone DDS (Branch master)
* License: Eclipse Public License v. 2.0 or the Eclipse Distribution License v. 1.0
* Project: https://github.com/eclipse-cyclonedds/cyclonedds-cxx
* Source: https://github.com/eclipse-cyclonedds/cyclonedds-cxx/tree/idlcxx
Expand Down
27 changes: 27 additions & 0 deletions cmake/cyclonedds/0001_cyclonedds_cxx_sampleref.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
diff --git a/src/ddscxx/include/dds/sub/detail/SampleRef.hpp b/src/ddscxx/include/dds/sub/detail/SampleRef.hpp
index 0e2f80e..73b30d5 100644
--- a/src/ddscxx/include/dds/sub/detail/SampleRef.hpp
+++ b/src/ddscxx/include/dds/sub/detail/SampleRef.hpp
@@ -61,7 +61,10 @@ public:

virtual ~SampleRef()
{
- ddsi_serdata_unref(reinterpret_cast<ddsi_serdata*>(data_));
+ if (data_ != nullptr)
+ {
+ ddsi_serdata_unref(reinterpret_cast<ddsi_serdata*>(data_));
+ }
}

SampleRef& operator=(const SampleRef& other)
@@ -76,6 +79,10 @@ public:
public:
const T& data() const
{
+ if (data_ == nullptr)
+ {
+ throw dds::core::Error("Data is Null");
+ }
return *data_->getT();
}

13 changes: 12 additions & 1 deletion cmake/cyclonedds/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@ function(fetch_and_install name)
message(FATAL_ERROR "Build step [download] for ${name} failed: ${result}")
endif()

if("${name}" STREQUAL "cyclonedds-cxx")
execute_process(
COMMAND git apply -p1 --ignore-space-change --whitespace=nowarn
INPUT_FILE "${CMAKE_CURRENT_LIST_DIR}/0001_cyclonedds_cxx_sampleref.patch"
WORKING_DIRECTORY "${SOURCE_DIR}"
RESULT_VARIABLE result)
if(result)
message(WARNING "CMake step [patch] for cyclonedds-cxx failed: ${result}! Build of cyclonedds-cxx might fail")
endif()
endif()

# Build
execute_process(COMMAND ${CREATE_PATH_COMMAND} "${BUILD_DIR}"
RESULT_VARIABLE result
Expand Down Expand Up @@ -93,5 +104,5 @@ endfunction()

# ===== Install

fetch_and_install(cyclonedds -DBUILD_IDLC=OFF)
fetch_and_install(cyclonedds -DBUILD_IDLC=ON)
fetch_and_install(cyclonedds-cxx)
2 changes: 1 addition & 1 deletion cmake/cyclonedds/cyclonedds-cxx.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ project(cyclonedds-cxx-download NONE)
include(ExternalProject)
ExternalProject_Add(ext_cyclonedds_cxx
GIT_REPOSITORY https://github.com/eclipse-cyclonedds/cyclonedds-cxx.git
GIT_TAG b68944232945ce2164a4daef67291564c83cc604
GIT_TAG ca478d5d1e3b1cfe6b5791248feb7d79d4af3ce0
SOURCE_DIR "${CMAKE_BINARY_DIR}/dependencies/cyclonedds-cxx/src"
BINARY_DIR "${CMAKE_BINARY_DIR}/dependencies/cyclonedds-cxx/build"
CONFIGURE_COMMAND ""
Expand Down
2 changes: 1 addition & 1 deletion cmake/cyclonedds/cyclonedds.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ project(cyclonedds-download NONE)
include(ExternalProject)
ExternalProject_Add(ext_cyclonedds
GIT_REPOSITORY https://github.com/eclipse-cyclonedds/cyclonedds.git
GIT_TAG a5db83fe94e9f4afe896e335e69bc5bea741e4d8
GIT_TAG 7bc432683690ba860a72c662395c07835ce0b3a4
SOURCE_DIR "${CMAKE_BINARY_DIR}/dependencies/cyclonedds/src"
BINARY_DIR "${CMAKE_BINARY_DIR}/dependencies/cyclonedds/build"
CONFIGURE_COMMAND ""
Expand Down
10 changes: 3 additions & 7 deletions iceoryx_dds/cmake/idlcxx-generate.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,13 @@
# SPDX-License-Identifier: Apache-2.0

#
# Generates all message definitions required by iceoryx_dds and packages
# Generates all message definitions required by iceoryx_dds and packages
# them into a single library.
#
cmake_minimum_required(VERSION 3.5)
project(idlcxx-generator)

find_package(CycloneDDS CONFIG REQUIRED)
find_package(CycloneDDS-CXX CONFIG REQUIRED)

if(NOT TARGET CycloneDDS-CXX::ddscxx)
find_package(CycloneDDS-CXX REQUIRED)
endif()
find_package(CycloneDDS-CXX REQUIRED)

add_library(iceoryx_dds_messages)

Expand All @@ -40,6 +35,7 @@ target_link_libraries(iceoryx_dds_messages
)

set_target_properties(iceoryx_dds_messages PROPERTIES
LINKER_LANGUAGE CXX
CXX_STANDARD_REQUIRED ON
CXX_STANDARD 14
POSITION_INDEPENDENT_CODE ON
Expand Down
2 changes: 0 additions & 2 deletions tools/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ RUN apt-get update && apt-get install -y \
git \
wget



ADD . /iceoryx
WORKDIR /iceoryx

Expand Down

0 comments on commit a4ba5f9

Please sign in to comment.