2018-11-20 00:48:22 +00:00
|
|
|
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
|
# Licensed under the MIT License.
|
|
|
|
|
|
2019-04-29 19:58:20 +00:00
|
|
|
file(GLOB_RECURSE onnxruntime_framework_srcs CONFIGURE_DEPENDS
|
2018-11-20 00:48:22 +00:00
|
|
|
"${ONNXRUNTIME_INCLUDE_DIR}/core/framework/*.h"
|
|
|
|
|
"${ONNXRUNTIME_ROOT}/core/framework/*.h"
|
|
|
|
|
"${ONNXRUNTIME_ROOT}/core/framework/*.cc"
|
|
|
|
|
)
|
|
|
|
|
|
2020-08-21 21:14:53 +00:00
|
|
|
if (onnxruntime_MINIMAL_BUILD)
|
2020-09-01 01:51:31 +00:00
|
|
|
file(GLOB onnxruntime_framework_src_exclude
|
2020-08-21 21:14:53 +00:00
|
|
|
"${ONNXRUNTIME_ROOT}/core/framework/provider_bridge_ort.cc"
|
|
|
|
|
"${ONNXRUNTIME_ROOT}/core/framework/graph_partitioner.*"
|
2020-08-22 21:02:13 +00:00
|
|
|
"${ONNXRUNTIME_INCLUDE_DIR}/core/framework/customregistry.h"
|
|
|
|
|
"${ONNXRUNTIME_ROOT}/core/framework/customregistry.cc"
|
2020-08-21 21:14:53 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
list(REMOVE_ITEM onnxruntime_framework_srcs ${onnxruntime_framework_src_exclude})
|
|
|
|
|
endif()
|
|
|
|
|
|
2018-11-20 00:48:22 +00:00
|
|
|
source_group(TREE ${REPO_ROOT} FILES ${onnxruntime_framework_srcs})
|
|
|
|
|
|
|
|
|
|
add_library(onnxruntime_framework ${onnxruntime_framework_srcs})
|
2019-11-12 05:34:10 +00:00
|
|
|
if(onnxruntime_ENABLE_INSTRUMENT)
|
|
|
|
|
target_compile_definitions(onnxruntime_framework PRIVATE ONNXRUNTIME_ENABLE_INSTRUMENT)
|
|
|
|
|
endif()
|
2020-09-15 05:48:00 +00:00
|
|
|
if(onnxruntime_USE_TENSORRT)
|
|
|
|
|
# TODO: for now, core framework depends on CUDA. It should be moved to TensorRT EP
|
|
|
|
|
target_include_directories(onnxruntime_framework PRIVATE ${ONNXRUNTIME_ROOT} ${onnxruntime_CUDNN_HOME}/include PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})
|
|
|
|
|
else()
|
2020-08-13 22:24:44 +00:00
|
|
|
target_include_directories(onnxruntime_framework PRIVATE ${ONNXRUNTIME_ROOT} PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
|
2020-09-15 05:48:00 +00:00
|
|
|
endif()
|
2020-09-01 01:51:31 +00:00
|
|
|
onnxruntime_add_include_to_target(onnxruntime_framework onnxruntime_common onnx onnx_proto protobuf::libprotobuf flatbuffers)
|
2018-11-20 00:48:22 +00:00
|
|
|
set_target_properties(onnxruntime_framework PROPERTIES FOLDER "ONNXRuntime")
|
|
|
|
|
# need onnx to build to create headers that this project includes
|
|
|
|
|
add_dependencies(onnxruntime_framework ${onnxruntime_EXTERNAL_DEPENDENCIES})
|
|
|
|
|
|
2019-06-12 20:47:50 +00:00
|
|
|
if (onnxruntime_DEBUG_NODE_INPUTS_OUTPUTS)
|
2020-08-31 17:17:23 +00:00
|
|
|
target_compile_definitions(onnxruntime_framework PRIVATE DEBUG_NODE_INPUTS_OUTPUTS)
|
2019-06-12 20:47:50 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
2018-11-23 04:56:43 +00:00
|
|
|
install(DIRECTORY ${PROJECT_SOURCE_DIR}/../include/onnxruntime/core/framework DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/onnxruntime/core)
|
2018-11-20 00:48:22 +00:00
|
|
|
if (WIN32)
|
|
|
|
|
# Add Code Analysis properties to enable C++ Core checks. Have to do it via a props file include.
|
|
|
|
|
set_target_properties(onnxruntime_framework PROPERTIES VS_USER_PROPS ${PROJECT_SOURCE_DIR}/ConfigureVisualStudioCodeAnalysis.props)
|
|
|
|
|
endif()
|
2020-03-11 21:25:37 +00:00
|
|
|
|