Skip to content

Commit

Permalink
Disable the -Wshadow warning when building under clang. (#45)
Browse files Browse the repository at this point in the history
There are a bunch of shadowed variables within yaml-cpp
itself.  Disable the warnings we get when compiling under
clang by removing the -Wshadow flag.

Signed-off-by: Chris Lalancette <[email protected]>
  • Loading branch information
clalancette authored Dec 2, 2023
1 parent 4e1e492 commit dd97491
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ament_vendor(yaml_cpp_vendor
SATISFIED ${yaml-cpp_FOUND}
VCS_URL https://github.com/jbeder/yaml-cpp.git
VCS_VERSION yaml-cpp-0.7.0
PATCHES patches
CMAKE_ARGS
"-DCMAKE_CXX_FLAGS=${YAML_CPP_CXX_FLAGS}"
-DYAML_CPP_BUILD_CONTRIB:BOOL=OFF
Expand Down
11 changes: 11 additions & 0 deletions patches/0001-disable-shadow-warning.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/CMakeLists.txt 2023-12-01 16:47:18.388383723 +0000
+++ b/CMakeLists.txt 2023-12-01 16:47:23.630353853 +0000
@@ -93,7 +93,7 @@ endif()

target_compile_options(yaml-cpp
PRIVATE
- $<${not-msvc}:-Wall -Wextra -Wshadow -Weffc++ -Wno-long-long>
+ $<${not-msvc}:-Wall -Wextra -Weffc++ -Wno-long-long>
$<${not-msvc}:-pedantic -pedantic-errors>

$<$<AND:${backport-msvc-runtime},${msvc-rt-mtd-static}>:-MTd>

0 comments on commit dd97491

Please sign in to comment.