Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

fix warnings #40

Merged
merged 8 commits into from
Jun 16, 2015
Merged
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
4 changes: 3 additions & 1 deletion rmw_connext_cpp/src/functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wall"
#pragma GCC diagnostic ignored "-Wdeprecated-register"
#ifdef __clang__
# pragma clang diagnostic ignored "-Wdeprecated-register"
#endif
#include <ndds/ndds_cpp.h>
#include <ndds/ndds_requestreply_cpp.h>
#pragma GCC diagnostic pop
Expand Down
4 changes: 3 additions & 1 deletion rmw_connext_dynamic_cpp/src/functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wall"
#pragma GCC diagnostic ignored "-Wdeprecated-register"
#ifdef __clang__
# pragma clang diagnostic ignored "-Wdeprecated-register"
#endif
#include <ndds/connext_cpp/connext_cpp_replier_details.h>
#include <ndds/connext_cpp/connext_cpp_requester_details.h>
#include <ndds/ndds_cpp.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ endforeach()

set(_output_path "${CMAKE_CURRENT_BINARY_DIR}/rosidl_typesupport_connext_cpp/${PROJECT_NAME}")
set(_generated_msg_files "")
set(_generated_external_msg_files "")
set(_generated_srv_files "")
foreach(_idl_file ${rosidl_generate_interfaces_IDL_FILES})
get_filename_component(_extension "${_idl_file}" EXT)
Expand All @@ -51,12 +52,12 @@ foreach(_idl_file ${rosidl_generate_interfaces_IDL_FILES})
if("${_extension} " STREQUAL ".msg ")
get_filename_component(_parent_folder "${_idl_file}" DIRECTORY)
get_filename_component(_parent_folder "${_parent_folder}" NAME)
list(APPEND _generated_msg_files "${_output_path}/${_parent_folder}/dds_connext/${_msg_name}_.h")
list(APPEND _generated_msg_files "${_output_path}/${_parent_folder}/dds_connext/${_msg_name}_.cxx")
list(APPEND _generated_msg_files "${_output_path}/${_parent_folder}/dds_connext/${_msg_name}_Plugin.h")
list(APPEND _generated_msg_files "${_output_path}/${_parent_folder}/dds_connext/${_msg_name}_Plugin.cxx")
list(APPEND _generated_msg_files "${_output_path}/${_parent_folder}/dds_connext/${_msg_name}_Support.h")
list(APPEND _generated_msg_files "${_output_path}/${_parent_folder}/dds_connext/${_msg_name}_Support.cxx")
list(APPEND _generated_external_msg_files "${_output_path}/${_parent_folder}/dds_connext/${_msg_name}_.h")
list(APPEND _generated_external_msg_files "${_output_path}/${_parent_folder}/dds_connext/${_msg_name}_.cxx")
list(APPEND _generated_external_msg_files "${_output_path}/${_parent_folder}/dds_connext/${_msg_name}_Plugin.h")
list(APPEND _generated_external_msg_files "${_output_path}/${_parent_folder}/dds_connext/${_msg_name}_Plugin.cxx")
list(APPEND _generated_external_msg_files "${_output_path}/${_parent_folder}/dds_connext/${_msg_name}_Support.h")
list(APPEND _generated_external_msg_files "${_output_path}/${_parent_folder}/dds_connext/${_msg_name}_Support.cxx")
list(APPEND _generated_msg_files "${_output_path}/${_parent_folder}/dds_connext/${_header_name}__type_support.hpp")
list(APPEND _generated_msg_files "${_output_path}/${_parent_folder}/dds_connext/${_header_name}__type_support.cpp")
elseif("${_extension} " STREQUAL ".srv ")
Expand All @@ -68,16 +69,29 @@ endforeach()

# If not on Windows, disable some warnings with Connext's generated code
if(NOT WIN32)
set(_connext_compile_flags
"-Wno-tautological-compare"
"-Wno-return-type-c-linkage"
"-Wno-deprecated-register"
)
string(REPLACE ";" " " _connext_compile_flags ${_connext_compile_flags})
foreach(_gen_file ${_generated_msg_files} ${_generated_srv_files})
set_source_files_properties("${_gen_file}"
PROPERTIES COMPILE_FLAGS ${_connext_compile_flags})
endforeach()
set(_connext_compile_flags)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(_connext_compile_flags
"-Wno-deprecated-register"
"-Wno-mismatched-tags"
"-Wno-return-type-c-linkage"
"-Wno-sometimes-uninitialized"
"-Wno-tautological-compare"
"-Wno-unused-variable"
)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(_connext_compile_flags
"-Wno-unused-but-set-variable"
"-Wno-unused-variable"
)
endif()
if(NOT "${_connext_compile_flags} " STREQUAL " ")
string(REPLACE ";" " " _connext_compile_flags "${_connext_compile_flags}")
foreach(_gen_file ${_generated_external_msg_files})
set_source_files_properties("${_gen_file}"
PROPERTIES COMPILE_FLAGS ${_connext_compile_flags})
endforeach()
endif()
endif()

set(_dependency_files "")
Expand All @@ -100,7 +114,7 @@ foreach(_pkg_name ${rosidl_generate_interfaces_DEPENDENCY_PACKAGE_NAMES})
endforeach()

add_custom_command(
OUTPUT ${_generated_msg_files} ${_generated_srv_files}
OUTPUT ${_generated_msg_files} ${_generated_external_msg_files} ${_generated_srv_files}
COMMAND ${PYTHON_EXECUTABLE} ${rosidl_typesupport_connext_cpp_BIN}
--pkg-name ${PROJECT_NAME}
--ros-interface-files ${rosidl_generate_interfaces_IDL_FILES}
Expand Down Expand Up @@ -130,7 +144,7 @@ endif()

link_directories(${Connext_LIBRARY_DIRS})
add_library(${rosidl_generate_interfaces_TARGET}${_target_suffix} SHARED
${_generated_msg_files} ${_generated_srv_files})
${_generated_msg_files} ${_generated_external_msg_files} ${_generated_srv_files})
if(WIN32)
target_compile_definitions(${rosidl_generate_interfaces_TARGET}${_target_suffix}
PRIVATE "ROSIDL_BUILDING_DLL")
Expand Down Expand Up @@ -175,9 +189,9 @@ add_dependencies(
${rosidl_generate_interfaces_TARGET}${_target_suffix}
)

if(NOT "${_generated_msg_files} " STREQUAL " ")
if(NOT "${_generated_msg_files}${_generated_external_msg_files} " STREQUAL " ")
install(
FILES ${_generated_msg_files}
FILES ${_generated_msg_files} ${_generated_external_msg_files}
DESTINATION "include/${PROJECT_NAME}/msg/dds_connext"
)
endif()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
#include "@(spec.base_type.pkg_name)/@(subfolder)/@(get_header_filename_from_msg_name(spec.base_type.type))__struct.hpp"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wall"
#pragma GCC diagnostic ignored "-Wdeprecated-register"
#ifdef __clang__
# pragma clang diagnostic ignored "-Wdeprecated-register"
#endif
#include "@(spec.base_type.pkg_name)/@(subfolder)/dds_connext/@(spec.base_type.type)_Support.h"
#include "@(spec.base_type.pkg_name)/@(subfolder)/dds_connext/@(get_header_filename_from_msg_name(spec.base_type.type))__type_support.hpp"
#pragma GCC diagnostic pop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wall"
#pragma GCC diagnostic ignored "-Wdeprecated-register"
#ifdef __clang__
# pragma clang diagnostic ignored "-Wdeprecated-register"
#endif
#include <ndds/connext_cpp/connext_cpp_requester_details.h>
#include <ndds/ndds_cpp.h>
#include <ndds/ndds_requestreply_cpp.h>
Expand Down