Skip to content

Commit

Permalink
Move /ignore:4099 into nmos-cpp target so that not every executable n…
Browse files Browse the repository at this point in the history
…eeds to do it (seems no worse than force disabling compiler warnings)
  • Loading branch information
garethsb committed Aug 2, 2021
1 parent bd3fc53 commit a01451b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 31 deletions.
12 changes: 12 additions & 0 deletions Development/cmake/NmosCppLibraries.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,18 @@ if(BUILD_LLDP)
)
endif()

if(${CMAKE_SYSTEM_NAME} MATCHES "Windows" AND ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.13.0")
# Conan packages usually don't include PDB files so suppress the resulting warning
# which is otherwise reported more than 500 times (across cpprest.pdb, ossl_static.pdb and zlibstatic.pdb)
# when linking to nmos-cpp and its dependencies
# see https://github.com/conan-io/conan-center-index/blob/master/docs/faqs.md#why-pdb-files-are-not-allowed
# and https://github.com/conan-io/conan-center-index/issues/1982
target_link_options(
nmos-cpp INTERFACE
/ignore:4099
)
endif()

install(TARGETS nmos-cpp DESTINATION lib)

install(FILES ${NMOS_CPP_BST_HEADERS} DESTINATION include${NMOS_CPP_INCLUDE_PREFIX}/bst)
Expand Down
11 changes: 0 additions & 11 deletions Development/cmake/NmosCppNode.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,4 @@ source_group("Header Files" FILES ${NMOS_CPP_NODE_HEADERS})
target_link_libraries(
nmos-cpp-node
nmos-cpp::nmos-cpp
nmos-cpp::cpprestsdk
nmos-cpp::Boost
)

if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
# Conan packages usually don't include PDB files so suppress the resulting warning
set_target_properties(
nmos-cpp-node
PROPERTIES
LINK_FLAGS "/ignore:4099"
)
endif()
11 changes: 0 additions & 11 deletions Development/cmake/NmosCppRegistry.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,4 @@ source_group("Header Files" FILES ${NMOS_CPP_REGISTRY_HEADERS})
target_link_libraries(
nmos-cpp-registry
nmos-cpp::nmos-cpp
nmos-cpp::cpprestsdk
nmos-cpp::Boost
)

if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
# Conan packages usually don't include PDB files so suppress the resulting warning
set_target_properties(
nmos-cpp-registry
PROPERTIES
LINK_FLAGS "/ignore:4099"
)
endif()
9 changes: 0 additions & 9 deletions Development/cmake/NmosCppTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,6 @@ if(BUILD_LLDP)
)
endif()

if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
# Conan packages usually don't include PDB files so suppress the resulting warning
set_target_properties(
nmos-cpp-test
PROPERTIES
LINK_FLAGS "/ignore:4099"
)
endif()

include(Catch)

catch_discover_tests(nmos-cpp-test EXTRA_ARGS -r compact)

0 comments on commit a01451b

Please sign in to comment.