Skip to content

Commit

Permalink
Do not pass warning printing flags to NVHPC
Browse files Browse the repository at this point in the history
  • Loading branch information
davschneller committed Oct 11, 2024
1 parent da82fd9 commit 78d6f4e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ endif()

set(build-shared $<BOOL:${YAML_BUILD_SHARED_LIBS}>)
set(build-windows-dll $<AND:$<BOOL:${CMAKE_HOST_WIN32}>,${build-shared}>)
set(not-msvc $<NOT:$<CXX_COMPILER_ID:MSVC>>)
set(msvc-shared_rt $<BOOL:${YAML_MSVC_SHARED_RT}>)

set(print-warnings $<NOT:$<OR:$<CXX_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:NVHPC>>>)

if (NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)
set(CMAKE_MSVC_RUNTIME_LIBRARY
MultiThreaded$<$<CONFIG:Debug>:Debug>$<${msvc-shared_rt}:DLL>)
Expand Down Expand Up @@ -111,8 +112,8 @@ 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>)
$<${print-warnings}:-Wall -Wextra -Wshadow -Weffc++ -Wno-long-long>
$<${print-warnings}:-pedantic -pedantic-errors>)
endif()

target_compile_options(yaml-cpp
Expand Down

0 comments on commit 78d6f4e

Please sign in to comment.