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_util_srcs CONFIGURE_DEPENDS
|
2018-11-20 00:48:22 +00:00
|
|
|
"${ONNXRUNTIME_ROOT}/core/util/*.h"
|
|
|
|
|
"${ONNXRUNTIME_ROOT}/core/util/*.cc"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
source_group(TREE ${ONNXRUNTIME_ROOT}/core FILES ${onnxruntime_util_srcs})
|
|
|
|
|
|
2021-04-29 18:54:57 +00:00
|
|
|
onnxruntime_add_static_library(onnxruntime_util ${onnxruntime_util_srcs})
|
2021-02-04 16:38:56 +00:00
|
|
|
target_include_directories(onnxruntime_util PRIVATE ${ONNXRUNTIME_ROOT} PUBLIC ${eigen_INCLUDE_DIRS})
|
2022-03-02 03:47:55 +00:00
|
|
|
onnxruntime_add_include_to_target(onnxruntime_util onnxruntime_common onnx onnx_proto ${PROTOBUF_LIB})
|
2019-01-07 21:15:24 +00:00
|
|
|
if(UNIX)
|
|
|
|
|
target_compile_options(onnxruntime_util PUBLIC "-Wno-error=comment")
|
|
|
|
|
endif()
|
2018-11-20 00:48:22 +00:00
|
|
|
set_target_properties(onnxruntime_util PROPERTIES LINKER_LANGUAGE CXX)
|
|
|
|
|
set_target_properties(onnxruntime_util PROPERTIES FOLDER "ONNXRuntime")
|
2019-04-19 00:00:21 +00:00
|
|
|
add_dependencies(onnxruntime_util ${onnxruntime_EXTERNAL_DEPENDENCIES})
|
2018-11-20 00:48:22 +00:00
|
|
|
if (WIN32)
|
|
|
|
|
target_compile_definitions(onnxruntime_util PRIVATE _SCL_SECURE_NO_WARNINGS)
|
|
|
|
|
endif()
|
2022-04-04 05:37:18 +00:00
|
|
|
|
|
|
|
|
if (NOT onnxruntime_BUILD_SHARED_LIB)
|
|
|
|
|
install(TARGETS onnxruntime_util
|
|
|
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
|
|
|
FRAMEWORK DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
|
endif()
|