mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-18 21:21:17 +00:00
Ignore deprecated declarations warning for TRT EP build (#16948)
In additions to `onnxruntime_test_all`, `onnxruntime_shared_lib_test` and `onnxruntime_customopregistration_test` should also add "-Wno-deprecated-declarations" flag to ignore compiler warning
This commit is contained in:
parent
f8d933df31
commit
f4faceab28
1 changed files with 15 additions and 0 deletions
|
|
@ -842,6 +842,8 @@ if (HAS_SHORTEN_64_TO_32 AND NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|||
endif()
|
||||
|
||||
if (UNIX AND onnxruntime_USE_TENSORRT)
|
||||
# The test_main.cc includes NvInfer.h where it has many deprecated declarations
|
||||
# simply ignore them for TensorRT EP build
|
||||
set_property(TARGET onnxruntime_test_all APPEND_STRING PROPERTY COMPILE_FLAGS "-Wno-deprecated-declarations")
|
||||
endif()
|
||||
|
||||
|
|
@ -1276,6 +1278,12 @@ if (NOT onnxruntime_ENABLE_TRAINING_TORCH_INTEROP)
|
|||
$<TARGET_FILE_DIR:onnxruntime_shared_lib_test>/testdata)
|
||||
endif()
|
||||
|
||||
if (UNIX AND onnxruntime_USE_TENSORRT)
|
||||
# The test_main.cc includes NvInfer.h where it has many deprecated declarations
|
||||
# simply ignore them for TensorRT EP build
|
||||
set_property(TARGET onnxruntime_shared_lib_test APPEND_STRING PROPERTY COMPILE_FLAGS "-Wno-deprecated-declarations")
|
||||
endif()
|
||||
|
||||
# test inference using global threadpools
|
||||
if (NOT CMAKE_SYSTEM_NAME MATCHES "Android|iOS" AND NOT onnxruntime_MINIMAL_BUILD)
|
||||
AddTest(DYN
|
||||
|
|
@ -1531,6 +1539,13 @@ if (NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
|
|||
${TEST_DATA_SRC}
|
||||
$<TARGET_FILE_DIR:onnxruntime_customopregistration_test>/testdata)
|
||||
endif()
|
||||
|
||||
if (UNIX AND onnxruntime_USE_TENSORRT)
|
||||
# The test_main.cc includes NvInfer.h where it has many deprecated declarations
|
||||
# simply ignore them for TensorRT EP build
|
||||
set_property(TARGET onnxruntime_customopregistration_test APPEND_STRING PROPERTY COMPILE_FLAGS "-Wno-deprecated-declarations")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue