Skip to content

Commit

Permalink
Add support for FastDDS versions earlier than 2.13
Browse files Browse the repository at this point in the history
Signed-off-by: Irene Bandera <irenebandera@eprosima.com>
  • Loading branch information
irenebm committed Jan 11, 2024
1 parent 16b1acb commit c294420
Show file tree
Hide file tree
Showing 219 changed files with 18,173 additions and 4 deletions.
11 changes: 9 additions & 2 deletions ddspipe_core/test/unittest/types/dynamic_types/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,15 @@

set(TEST_NAME dtypes_idl_tests)

# Determine Fast DDS version
if ("${FASTRTPS_VERSION}" LESS 2.13)
set(FASTDDS_SUBDIRECTORY "v1")
else()
set(FASTDDS_SUBDIRECTORY "v2")
endif()

# Add to test sources every FastDDSGen file generated
file(GLOB DATATYPE_SOURCES_CXX "types/**/*.cxx")
file(GLOB DATATYPE_SOURCES_CXX "types/${FASTDDS_SUBDIRECTORY}/**/*.cxx")
set(TEST_SOURCES
dtypes_idl_tests.cpp
${PROJECT_SOURCE_DIR}/src/cpp/types/dynamic_types/schema_idl.cpp
Expand Down Expand Up @@ -63,7 +70,7 @@ add_unittest_executable(
set(TEST_NAME dtypes_msg_tests)

# Add to test sources every FastDDSGen file generated
file(GLOB DATATYPE_SOURCES_CXX "types/**/*.cxx")
file(GLOB DATATYPE_SOURCES_CXX "types/${FASTDDS_SUBDIRECTORY}/**/*.cxx")
set(TEST_SOURCES
dtypes_msg_tests.cpp
${PROJECT_SOURCE_DIR}/src/cpp/types/dynamic_types/schema_msg.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@

#include <ddspipe_core/types/dynamic_types/schema.hpp>

#include "types/all_types.hpp"
#if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
#include "types/v1/all_types.hpp"
#else
#include "types/v2/all_types.hpp"
#endif // if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13

using namespace eprosima;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
#include <cpp_utils/file/file_utils.hpp>
#include <fastrtps/types/DynamicTypePtr.h>
#include <ddspipe_core/types/dynamic_types/schema.hpp>
#include "types/all_types.hpp"
#if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13
#include "types/v1/all_types.hpp"
#else
#include "types/v2/all_types.hpp"
#endif // if FASTRTPS_VERSION_MAJOR <= 2 && FASTRTPS_VERSION_MINOR < 13

using namespace eprosima;

Expand Down
Loading

0 comments on commit c294420

Please sign in to comment.