Skip to content

Commit

Permalink
disable fast dds warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Nir-Az committed Feb 3, 2025
1 parent 172c11e commit 2166d1c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMake/external_fastdds.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ function(get_fastdds)

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

disable_third_party_warnings(dds)

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 2166d1c

Please sign in to comment.