Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions fastdds_python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ endif()

project(fastdds_python VERSION 1.4.3)

if(NOT WIN32)
# Default values for shared library suffix in MacOS
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
set(CMAKE_SHARED_LIBRARY_SUFFIX ".so")
endif()
endif()

# Set BUILD_TESTING to OFF by default.
if(NOT BUILD_TESTING)
message(STATUS "Tests not compiled by default")
Expand Down
21 changes: 21 additions & 0 deletions fastdds_python/test/types/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ find_package(fastrtps REQUIRED)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)

if(NOT WIN32)
# Default values for shared library suffix in MacOS
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
set(CMAKE_SHARED_LIBRARY_SUFFIX ".so")
endif()
endif()

#Create library for C++ types
add_library(${PROJECT_NAME} SHARED
test_included_modules.cxx
Expand Down Expand Up @@ -135,6 +142,13 @@ find_package(fastrtps REQUIRED)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)

if(NOT WIN32)
# Default values for shared library suffix in MacOS
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
set(CMAKE_SHARED_LIBRARY_SUFFIX ".so")
endif()
endif()

#Create library for C++ types
add_library(${PROJECT_NAME} SHARED
test_modules.cxx
Expand Down Expand Up @@ -243,6 +257,13 @@ find_package(fastrtps REQUIRED)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)

if(NOT WIN32)
# Default values for shared library suffix in MacOS
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
set(CMAKE_SHARED_LIBRARY_SUFFIX ".so")
endif()
endif()

#Create library for C++ types
add_library(${PROJECT_NAME} SHARED
test_complete.cxx
Expand Down
87 changes: 87 additions & 0 deletions fastdds_python/test/types/test_complete.i
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,35 @@ namespace swig {



<<<<<<< HEAD
=======
%ignore StructType::fixed_string_field(eprosima::fastcdr::fixed_string<16>&&);


// Overloaded getter methods shadow each other and are equivalent in python
// Const accesors produced constant enums instead of arrays/dictionaries when used
// We ignore them to prevent this
%ignore StructType::fixed_string_field();
%rename("%s") StructType::fixed_string_field() const;

%template(fixed_string_16) eprosima::fastcdr::fixed_string<16>;
%extend StructType
{
void fixed_string_field(const std::string& value)
{
eprosima::fastcdr::fixed_string<16> tmp(value);
$self->fixed_string_field(tmp);
}

std::string fixed_string_field_str() const
{
return std::string($self->fixed_string_field(), strnlen($self->fixed_string_field(), 16));
}
}



>>>>>>> 57a5541 (Set CMAKE_SHARED_LIBRARY_SUFFIX to always create .so files (#207))
%ignore StructType::enum_field(Color&&);


Expand Down Expand Up @@ -410,6 +439,35 @@ namespace swig {



<<<<<<< HEAD
=======
%ignore CompleteTestType::fixed_string_field(eprosima::fastcdr::fixed_string<16>&&);


// Overloaded getter methods shadow each other and are equivalent in python
// Const accesors produced constant enums instead of arrays/dictionaries when used
// We ignore them to prevent this
%ignore CompleteTestType::fixed_string_field();
%rename("%s") CompleteTestType::fixed_string_field() const;

%template(fixed_string_16) eprosima::fastcdr::fixed_string<16>;
%extend CompleteTestType
{
void fixed_string_field(const std::string& value)
{
eprosima::fastcdr::fixed_string<16> tmp(value);
$self->fixed_string_field(tmp);
}

std::string fixed_string_field_str() const
{
return std::string($self->fixed_string_field(), strnlen($self->fixed_string_field(), 16));
}
}



>>>>>>> 57a5541 (Set CMAKE_SHARED_LIBRARY_SUFFIX to always create .so files (#207))
%ignore CompleteTestType::enum_field(Color&&);


Expand Down Expand Up @@ -1708,6 +1766,35 @@ namespace swig {



<<<<<<< HEAD
=======
%ignore KeyedCompleteTestType::fixed_string_field(eprosima::fastcdr::fixed_string<16>&&);


// Overloaded getter methods shadow each other and are equivalent in python
// Const accesors produced constant enums instead of arrays/dictionaries when used
// We ignore them to prevent this
%ignore KeyedCompleteTestType::fixed_string_field();
%rename("%s") KeyedCompleteTestType::fixed_string_field() const;

%template(fixed_string_16) eprosima::fastcdr::fixed_string<16>;
%extend KeyedCompleteTestType
{
void fixed_string_field(const std::string& value)
{
eprosima::fastcdr::fixed_string<16> tmp(value);
$self->fixed_string_field(tmp);
}

std::string fixed_string_field_str() const
{
return std::string($self->fixed_string_field(), strnlen($self->fixed_string_field(), 16));
}
}



>>>>>>> 57a5541 (Set CMAKE_SHARED_LIBRARY_SUFFIX to always create .so files (#207))
%ignore KeyedCompleteTestType::enum_field(Color&&);


Expand Down
87 changes: 87 additions & 0 deletions fastdds_python/test/types/test_modules.i
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,35 @@ namespace swig {



<<<<<<< HEAD
=======
%ignore eprosima::test::StructType::fixed_string_field(eprosima::fastcdr::fixed_string<16>&&);


// Overloaded getter methods shadow each other and are equivalent in python
// Const accesors produced constant enums instead of arrays/dictionaries when used
// We ignore them to prevent this
%ignore eprosima::test::StructType::fixed_string_field();
%rename("%s") eprosima::test::StructType::fixed_string_field() const;

%template(fixed_string_16) eprosima::fastcdr::fixed_string<16>;
%extend eprosima::test::StructType
{
void fixed_string_field(const std::string& value)
{
eprosima::fastcdr::fixed_string<16> tmp(value);
$self->fixed_string_field(tmp);
}

std::string fixed_string_field_str() const
{
return std::string($self->fixed_string_field(), strnlen($self->fixed_string_field(), 16));
}
}



>>>>>>> 57a5541 (Set CMAKE_SHARED_LIBRARY_SUFFIX to always create .so files (#207))
%ignore eprosima::test::StructType::enum_field(eprosima::test::Color&&);


Expand Down Expand Up @@ -398,6 +427,35 @@ namespace swig {



<<<<<<< HEAD
=======
%ignore eprosima::test::CompleteTestType::fixed_string_field(eprosima::fastcdr::fixed_string<16>&&);


// Overloaded getter methods shadow each other and are equivalent in python
// Const accesors produced constant enums instead of arrays/dictionaries when used
// We ignore them to prevent this
%ignore eprosima::test::CompleteTestType::fixed_string_field();
%rename("%s") eprosima::test::CompleteTestType::fixed_string_field() const;

%template(fixed_string_16) eprosima::fastcdr::fixed_string<16>;
%extend eprosima::test::CompleteTestType
{
void fixed_string_field(const std::string& value)
{
eprosima::fastcdr::fixed_string<16> tmp(value);
$self->fixed_string_field(tmp);
}

std::string fixed_string_field_str() const
{
return std::string($self->fixed_string_field(), strnlen($self->fixed_string_field(), 16));
}
}



>>>>>>> 57a5541 (Set CMAKE_SHARED_LIBRARY_SUFFIX to always create .so files (#207))
%ignore eprosima::test::CompleteTestType::enum_field(eprosima::test::Color&&);


Expand Down Expand Up @@ -1696,6 +1754,35 @@ namespace swig {



<<<<<<< HEAD
=======
%ignore eprosima::test::KeyedCompleteTestType::fixed_string_field(eprosima::fastcdr::fixed_string<16>&&);


// Overloaded getter methods shadow each other and are equivalent in python
// Const accesors produced constant enums instead of arrays/dictionaries when used
// We ignore them to prevent this
%ignore eprosima::test::KeyedCompleteTestType::fixed_string_field();
%rename("%s") eprosima::test::KeyedCompleteTestType::fixed_string_field() const;

%template(fixed_string_16) eprosima::fastcdr::fixed_string<16>;
%extend eprosima::test::KeyedCompleteTestType
{
void fixed_string_field(const std::string& value)
{
eprosima::fastcdr::fixed_string<16> tmp(value);
$self->fixed_string_field(tmp);
}

std::string fixed_string_field_str() const
{
return std::string($self->fixed_string_field(), strnlen($self->fixed_string_field(), 16));
}
}



>>>>>>> 57a5541 (Set CMAKE_SHARED_LIBRARY_SUFFIX to always create .so files (#207))
%ignore eprosima::test::KeyedCompleteTestType::enum_field(eprosima::test::Color&&);


Expand Down
7 changes: 7 additions & 0 deletions fastdds_python_examples/HelloWorldExample/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ find_package(fastrtps REQUIRED)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)

if(NOT WIN32)
# Default values for shared library suffix in MacOS
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
set(CMAKE_SHARED_LIBRARY_SUFFIX ".so")
endif()
endif()

#Create library for C++ types
add_library(${PROJECT_NAME} SHARED
HelloWorld.cxx
Expand Down
Loading