Skip to content

Commit eb889f6

Browse files
authored
PR #13737 from Nir-Az: Disable FastDDS third party compilation warnings
2 parents 818c156 + 6361a49 commit eb889f6

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

CMake/external_fastdds.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ function(get_fastdds)
6060

6161
add_library(dds INTERFACE)
6262
target_link_libraries( dds INTERFACE fastcdr fastrtps )
63+
64+
disable_third_party_warnings(fastcdr)
65+
disable_third_party_warnings(fastrtps)
6366

6467
add_definitions(-DBUILD_WITH_DDS)
6568

CMake/security_flags_helper_functions.cmake

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,27 @@ macro(unset_security_flags_for_executable) # replace flag fPIE (Position-Indepen
1818
string(REPLACE "-fPIE" "-fPIC" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
1919
endmacro()
2020

21+
macro(disable_third_party_warnings target)
22+
if (TARGET ${target}) # Ensure the target exists
23+
get_target_property(target_type ${target} TYPE)
24+
25+
if (target_type STREQUAL "INTERFACE_LIBRARY")
26+
if (WIN32)
27+
target_compile_options(${target} INTERFACE /W0)
28+
else()
29+
target_compile_options(${target} INTERFACE -w)
30+
endif()
31+
else()
32+
if (WIN32)
33+
target_compile_options(${target} PRIVATE /W0)
34+
else()
35+
target_compile_options(${target} PRIVATE -w)
36+
endif()
37+
endif()
38+
else()
39+
message(WARNING "Target '${target}' does not exist.")
40+
endif()
41+
endmacro()
42+
43+
44+

0 commit comments

Comments
 (0)