Skip to content

Commit

Permalink
PR #13737 from Nir-Az: Disable FastDDS third party compilation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Nir-Az authored Feb 3, 2025
2 parents 818c156 + 6361a49 commit eb889f6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CMake/external_fastdds.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ function(get_fastdds)

add_library(dds INTERFACE)
target_link_libraries( dds INTERFACE fastcdr fastrtps )

disable_third_party_warnings(fastcdr)
disable_third_party_warnings(fastrtps)

add_definitions(-DBUILD_WITH_DDS)

Expand Down
24 changes: 24 additions & 0 deletions CMake/security_flags_helper_functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,27 @@ macro(unset_security_flags_for_executable) # replace flag fPIE (Position-Indepen
string(REPLACE "-fPIE" "-fPIC" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
endmacro()

macro(disable_third_party_warnings target)
if (TARGET ${target}) # Ensure the target exists
get_target_property(target_type ${target} TYPE)

if (target_type STREQUAL "INTERFACE_LIBRARY")
if (WIN32)
target_compile_options(${target} INTERFACE /W0)
else()
target_compile_options(${target} INTERFACE -w)
endif()
else()
if (WIN32)
target_compile_options(${target} PRIVATE /W0)
else()
target_compile_options(${target} PRIVATE -w)
endif()
endif()
else()
message(WARNING "Target '${target}' does not exist.")
endif()
endmacro()



0 comments on commit eb889f6

Please sign in to comment.