Skip to content

Commit d4b7a18

Browse files
committed
use generator exp to work with multi config build
1 parent c972758 commit d4b7a18

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

cmake/onnxruntime_providers_openvino.cmake

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,17 @@
3838
source_group(TREE ${ONNXRUNTIME_ROOT}/core FILES ${onnxruntime_providers_openvino_cc_srcs})
3939
onnxruntime_add_shared_library_module(onnxruntime_providers_openvino ${onnxruntime_providers_openvino_cc_srcs} "${ONNXRUNTIME_ROOT}/core/dll/onnxruntime.rc")
4040

41-
if(NOT CMAKE_BUILD_TYPE STREQUAL "Release")
42-
target_compile_definitions(onnxruntime_providers_openvino PRIVATE
43-
OPENVINO_NON_RELEASE_BUILD=1
44-
)
45-
endif()
46-
4741
onnxruntime_add_include_to_target(onnxruntime_providers_openvino onnxruntime_common onnx nlohmann_json::nlohmann_json)
4842
install(FILES ${PROJECT_SOURCE_DIR}/../include/onnxruntime/core/providers/openvino/openvino_provider_factory.h
4943
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/onnxruntime/)
5044
set_target_properties(onnxruntime_providers_openvino PROPERTIES CXX_STANDARD 20)
5145
set_target_properties(onnxruntime_providers_openvino PROPERTIES LINKER_LANGUAGE CXX)
5246
set_target_properties(onnxruntime_providers_openvino PROPERTIES FOLDER "ONNXRuntime")
47+
48+
target_compile_options(onnxruntime_providers_openvino PRIVATE
49+
$<$<NOT:$<CONFIG:Release>>:-DNOT_RELEASE>
50+
)
51+
5352
if(NOT MSVC)
5453
target_compile_options(onnxruntime_providers_openvino PRIVATE "-Wno-parentheses")
5554
endif()

onnxruntime/core/providers/openvino/backend_manager.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ static bool IsQDQGraph(const onnxruntime::GraphViewer& graph_viewer) {
324324
static void DumpOpenVINOEPModel([[maybe_unused]] const std::filesystem::path& onnx_model_path_name,
325325
[[maybe_unused]] ONNX_NAMESPACE::ModelProto* model_proto,
326326
[[maybe_unused]] const onnxruntime::Node& fused_node) {
327-
#ifdef OPENVINO_NON_RELEASE_BUILD
327+
#ifdef NOT_RELEASE
328328
if (openvino_ep::backend_utils::IsDebugEnabled()) {
329329
auto model_name = onnx_model_path_name.empty() ? "unknown.onnx" : onnx_model_path_name.filename();
330330

0 commit comments

Comments
 (0)