Minimize warnings when not the top-level project (#1124)

Minimize warnings when not the top-level project

Should fix #970 and #764 when trying to add yaml-cpp to other project
This commit is contained in:
Baruch
2022-09-20 08:22:11 +03:00
committed by GitHub
parent 255bf1f9bc
commit c86a9e424c

View File

@@ -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>