Skip to content

Commit

Permalink
Refs #19760. Coexist fastcdr v1 and v2
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo González Moreno <[email protected]>
  • Loading branch information
richiware committed Nov 8, 2023
1 parent ffaeea7 commit 8100c26
Show file tree
Hide file tree
Showing 42 changed files with 38,440 additions and 6,140 deletions.
2 changes: 1 addition & 1 deletion fastdds_python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ set(CMAKE_SWIG_FLAGS "")

find_package(Python3 COMPONENTS Interpreter Development REQUIRED)

find_package(fastcdr 2 REQUIRED)
find_package(fastcdr REQUIRED)
find_package(fastrtps 2.12 REQUIRED)

###############################################################################
Expand Down
3 changes: 3 additions & 0 deletions fastdds_python/src/swig/fastdds.i
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ namespace builtin {
// Failing to do so will issue a warning, but will not stop the compilation.
// However, the resulting derived class will **not** be considered as inheriting from the base class

%include <fastcdr/config.h>
#if FASTCDR_VERSION_MAJOR > 1
%include "fastcdr/xcdr/optional.i"
#endif

%include "fastdds/rtps/common/VendorId_t.i"
%include "fastdds/rtps/common/Types.i"
Expand Down
36 changes: 15 additions & 21 deletions fastdds_python/test/types/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,14 @@ project(test_included_modules)
find_package(fastcdr REQUIRED)
find_package(fastrtps REQUIRED)


set(${PROJECT_NAME}_FILES
test_included_modules.cxx
test_included_modulesPubSubTypes.cxx
)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)

#Create library for C++ types
add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}_FILES})
add_library(${PROJECT_NAME} SHARED
test_included_modules.cxx
test_included_modulesv1.cxx
test_included_modulesPubSubTypes.cxx
)
if(WIN32)
target_compile_definitions(${PROJECT_NAME} PRIVATE EPROSIMA_USER_DLL_EXPORT)
endif(WIN32)
Expand Down Expand Up @@ -135,16 +133,14 @@ project(test_modules)
find_package(fastcdr REQUIRED)
find_package(fastrtps REQUIRED)


set(${PROJECT_NAME}_FILES
test_modules.cxx
test_modulesPubSubTypes.cxx
)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)

#Create library for C++ types
add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}_FILES})
add_library(${PROJECT_NAME} SHARED
test_modules.cxx
test_modulesv1.cxx
test_modulesPubSubTypes.cxx
)
if(WIN32)
target_compile_definitions(${PROJECT_NAME} PRIVATE EPROSIMA_USER_DLL_EXPORT)
endif(WIN32)
Expand Down Expand Up @@ -245,16 +241,14 @@ project(test_complete)
find_package(fastcdr REQUIRED)
find_package(fastrtps REQUIRED)


set(${PROJECT_NAME}_FILES
test_complete.cxx
test_completePubSubTypes.cxx
)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)

#Create library for C++ types
add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}_FILES})
add_library(${PROJECT_NAME} SHARED
test_complete.cxx
test_completev1.cxx
test_completePubSubTypes.cxx
)
if(WIN32)
target_compile_definitions(${PROJECT_NAME} PRIVATE EPROSIMA_USER_DLL_EXPORT)
endif(WIN32)
Expand Down
2 changes: 1 addition & 1 deletion fastdds_python/test/types/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ if [[ -z "$(which fastddsgen)" ]]; then
exit -1
fi

fastddsgen -python -replace test_complete.idl test_modules.idl
fastddsgen -cdr both -python -replace test_complete.idl test_modules.idl
Loading

0 comments on commit 8100c26

Please sign in to comment.