2018-11-20 00:48:22 +00:00
|
|
|
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
|
# Licensed under the MIT License.
|
|
|
|
|
|
|
|
|
|
set (CSHARP_ROOT ${PROJECT_SOURCE_DIR}/../csharp)
|
|
|
|
|
set (CSHARP_MASTER_TARGET OnnxRuntime.CSharp)
|
2019-04-11 01:16:02 +00:00
|
|
|
set (CSHARP_MASTER_PROJECT ${CSHARP_ROOT}/OnnxRuntime.CSharp.proj)
|
|
|
|
|
if (onnxruntime_RUN_ONNX_TESTS)
|
|
|
|
|
set (CSHARP_DEPENDS onnxruntime ${test_data_target})
|
|
|
|
|
else()
|
|
|
|
|
set (CSHARP_DEPENDS onnxruntime)
|
|
|
|
|
endif()
|
|
|
|
|
|
2019-09-09 18:17:44 +00:00
|
|
|
if (onnxruntime_USE_CUDA)
|
2021-10-27 10:07:07 +00:00
|
|
|
STRING(APPEND CSHARP_PREPROCESSOR_DEFINES "USE_CUDA;")
|
2019-09-09 18:17:44 +00:00
|
|
|
endif()
|
|
|
|
|
|
2019-12-03 15:34:23 +00:00
|
|
|
if (onnxruntime_USE_DNNL)
|
2021-10-27 10:07:07 +00:00
|
|
|
STRING(APPEND CSHARP_PREPROCESSOR_DEFINES "USE_DNNL;")
|
2019-09-09 18:17:44 +00:00
|
|
|
endif()
|
|
|
|
|
|
2021-08-26 03:59:40 +00:00
|
|
|
if (onnxruntime_USE_DML)
|
2021-10-27 10:07:07 +00:00
|
|
|
STRING(APPEND CSHARP_PREPROCESSOR_DEFINES "USE_DML;")
|
2019-09-09 18:17:44 +00:00
|
|
|
endif()
|
|
|
|
|
|
2020-05-26 20:24:59 +00:00
|
|
|
if (onnxruntime_USE_MIGRAPHX)
|
2021-10-27 10:07:07 +00:00
|
|
|
STRING(APPEND CSHARP_PREPROCESSOR_DEFINES "USE_MIGRAPHX;")
|
2020-05-26 20:24:59 +00:00
|
|
|
endif()
|
|
|
|
|
|
2021-08-26 03:59:40 +00:00
|
|
|
if (onnxruntime_USE_NNAPI_BUILTIN)
|
2021-10-27 10:07:07 +00:00
|
|
|
STRING(APPEND CSHARP_PREPROCESSOR_DEFINES "USE_NNAPI;")
|
2019-09-09 18:17:44 +00:00
|
|
|
endif()
|
|
|
|
|
|
2022-02-15 09:21:02 +00:00
|
|
|
if (onnxruntime_USE_TVM)
|
|
|
|
|
STRING(APPEND CSHARP_PREPROCESSOR_DEFINES "USE_TVM,")
|
2021-12-16 00:59:20 +00:00
|
|
|
endif()
|
|
|
|
|
|
2021-08-26 03:59:40 +00:00
|
|
|
if (onnxruntime_USE_OPENVINO)
|
2021-10-27 10:07:07 +00:00
|
|
|
STRING(APPEND CSHARP_PREPROCESSOR_DEFINES "USE_OPENVINO;")
|
2021-08-26 03:59:40 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if (onnxruntime_USE_ROCM)
|
2021-10-27 10:07:07 +00:00
|
|
|
STRING(APPEND CSHARP_PREPROCESSOR_DEFINES "USE_ROCM;")
|
2021-08-26 03:59:40 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if (onnxruntime_USE_TENSORRT)
|
2021-10-27 10:07:07 +00:00
|
|
|
STRING(APPEND CSHARP_PREPROCESSOR_DEFINES "USE_TENSORRT;")
|
2021-08-26 03:59:40 +00:00
|
|
|
endif()
|
|
|
|
|
|
2022-06-15 21:01:41 +00:00
|
|
|
if (onnxruntime_USE_XNNPACK)
|
|
|
|
|
STRING(APPEND CSHARP_PREPROCESSOR_DEFINES "USE_XNNPACK;")
|
|
|
|
|
endif()
|
|
|
|
|
|
2023-01-03 21:28:16 +00:00
|
|
|
if (onnxruntime_ENABLE_TRAINING_APIS)
|
2022-12-05 22:54:09 +00:00
|
|
|
STRING(APPEND CSHARP_PREPROCESSOR_DEFINES "__TRAINING_ENABLED_NATIVE_BUILD__;")
|
|
|
|
|
endif()
|
|
|
|
|
|
2018-11-20 00:48:22 +00:00
|
|
|
include(CSharpUtilities)
|
|
|
|
|
|
2019-01-12 01:24:54 +00:00
|
|
|
# generate Directory.Build.props
|
|
|
|
|
set(DIRECTORY_BUILD_PROPS_COMMENT "WARNING: This is a generated file, please do not check it in!")
|
|
|
|
|
configure_file(${CSHARP_ROOT}/Directory.Build.props.in
|
|
|
|
|
${CSHARP_ROOT}/Directory.Build.props
|
|
|
|
|
@ONLY)
|