Skip to content

Commit

Permalink
Minimize warnings when not the top-level project (jbeder#1124)
Browse files Browse the repository at this point in the history
Minimize warnings when not the top-level project

Should fix jbeder#970 and jbeder#764 when trying to add yaml-cpp to other project
  • Loading branch information
BMBurstein authored and davemccann committed Jul 29, 2023
1 parent b66851c commit 378922f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,15 @@ if (NOT DEFINED CMAKE_CXX_STANDARD)
CXX_STANDARD 11)
endif()

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

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

$<$<AND:${backport-msvc-runtime},${msvc-rt-mtd-static}>:-MTd>
$<$<AND:${backport-msvc-runtime},${msvc-rt-mt-static}>:-MT>
$<$<AND:${backport-msvc-runtime},${msvc-rt-mtd-dll}>:-MDd>
Expand Down

0 comments on commit 378922f

Please sign in to comment.