
* Validation in Deserializer Added validation in CDR deserialization: max buffer length is checked when deserializing fields and strings are checked for null-terminator (except for wstrings, which are serialized without null-terminator). Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com> * Catch exceptions in serdata functions In serdata functions rmw_print, rmw_to_sample and rmw_from_sample catch exceptions so that correct return code is given when functions are called from ddsi. Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com> * Improve deserialisation validation Refactored the deserialisation validation functions so that sequence length is checked more properly and protection against overflows. Renamed source files for exceptions so that it conforms to ros2 / google c++ style guide. Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
106 lines
2.8 KiB
CMake
Executable file
106 lines
2.8 KiB
CMake
Executable file
# Copyright 2018 ADLINK Technology Limited.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
cmake_minimum_required(VERSION 3.5)
|
|
|
|
project(rmw_cyclonedds_cpp)
|
|
|
|
link_directories(/usr/local/lib)
|
|
|
|
# Default to C++14
|
|
if(NOT CMAKE_CXX_STANDARD)
|
|
set(CMAKE_CXX_STANDARD 14)
|
|
endif()
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
add_compile_options(-Wall -Wextra -Wpedantic)
|
|
endif()
|
|
|
|
find_package(ament_cmake_ros REQUIRED)
|
|
|
|
find_package(rcutils REQUIRED)
|
|
|
|
find_package(cyclonedds_cmake_module REQUIRED)
|
|
find_package(CycloneDDS REQUIRED CONFIG)
|
|
|
|
find_package(rmw REQUIRED)
|
|
find_package(rosidl_generator_c REQUIRED)
|
|
find_package(rosidl_typesupport_introspection_c REQUIRED)
|
|
find_package(rosidl_typesupport_introspection_cpp REQUIRED)
|
|
|
|
ament_export_dependencies(rcutils)
|
|
ament_export_dependencies(rmw)
|
|
ament_export_dependencies(rosidl_generator_c)
|
|
ament_export_dependencies(rosidl_typesupport_introspection_c)
|
|
ament_export_dependencies(rosidl_typesupport_introspection_cpp)
|
|
|
|
include_directories(include)
|
|
|
|
###??
|
|
|
|
add_library(rmw_cyclonedds_cpp
|
|
src/namespace_prefix.cpp
|
|
src/rmw_node.cpp
|
|
src/serdata.cpp
|
|
src/serdes.cpp
|
|
src/graphrhc.cpp
|
|
src/u16string.cpp
|
|
src/exception.cpp
|
|
src/deserialization_exception.cpp
|
|
)
|
|
|
|
target_link_libraries(rmw_cyclonedds_cpp CycloneDDS::ddsc)
|
|
|
|
ament_target_dependencies(rmw_cyclonedds_cpp
|
|
"rcutils"
|
|
"rosidl_typesupport_introspection_c"
|
|
"rosidl_typesupport_introspection_cpp"
|
|
"rmw"
|
|
"rosidl_generator_c"
|
|
)
|
|
|
|
configure_rmw_library(rmw_cyclonedds_cpp)
|
|
|
|
# Causes the visibility macros to use dllexport rather than dllimport,
|
|
# which is appropriate when building the dll but not consuming it.
|
|
target_compile_definitions(${PROJECT_NAME}
|
|
PRIVATE "RMW_CYCLONEDDS_CPP_BUILDING_LIBRARY")
|
|
|
|
ament_export_include_directories(include)
|
|
ament_export_libraries(rmw_cyclonedds_cpp)
|
|
|
|
register_rmw_implementation(
|
|
"c:rosidl_typesupport_c:rosidl_typesupport_introspection_c"
|
|
"cpp:rosidl_typesupport_cpp:rosidl_typesupport_introspection_cpp")
|
|
|
|
if(BUILD_TESTING)
|
|
find_package(ament_lint_auto REQUIRED)
|
|
ament_lint_auto_find_test_dependencies()
|
|
endif()
|
|
|
|
ament_package(
|
|
CONFIG_EXTRAS "rmw_cyclonedds_cpp-extras.cmake"
|
|
)
|
|
|
|
install(
|
|
DIRECTORY include/
|
|
DESTINATION include
|
|
)
|
|
|
|
install(
|
|
TARGETS rmw_cyclonedds_cpp
|
|
ARCHIVE DESTINATION lib
|
|
LIBRARY DESTINATION lib
|
|
RUNTIME DESTINATION bin
|
|
)
|