Skip to content

Commit

Permalink
Disable deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sashashura committed Nov 19, 2023
1 parent 60f9f91 commit fa2fab5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,13 @@ else()
endif()
endif()

if(PCAPPP_TARGET_COMPILER_CLANG
OR PCAPPP_TARGET_COMPILER_GCC
OR PCAPPP_TARGET_COMPILER_INTEL)
# Disable deprecated warnings since warnings are treated as errors
add_definitions("-Wno-deprecated-declarations")
endif()

if(PCAPPP_USE_DPDK)
find_package(DPDK)
if(NOT DPDK_FOUND)
Expand All @@ -197,8 +204,6 @@ if(PCAPPP_USE_DPDK)
add_definitions(-DUSE_DPDK_KNI)
endif()

# Disable deprecated warnings when DPDK enabled since warnings are treated as errors
add_definitions("-Wno-deprecated-declarations")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/setup_dpdk.py" "${CMAKE_CURRENT_BINARY_DIR}" COPYONLY)
endif()

Expand Down Expand Up @@ -243,8 +248,8 @@ endif()

if(PCAPPP_TARGET_COMPILER_MSVC)
# Disable VS warnings: Unknown pragma (4068), Zero-sized array in struct/union (4200), Possible loss of data (4244),
# Possible loss of data (4267), Character may not be represented (4819)
add_definitions("/wd4068 /wd4200 /wd4244 /wd4267 /wd4819")
# Possible loss of data (4267), Character may not be represented (4819), Deprecated (4996)
add_definitions("/wd4068 /wd4200 /wd4244 /wd4267 /wd4819 /wd4996")
endif()

if(PCAPPP_BUILD_COVERAGE)
Expand Down

0 comments on commit fa2fab5

Please sign in to comment.