2018-11-20 00:48:22 +00:00
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
file ( GLOB_RECURSE onnxruntime_graph_src
" $ { O N N X R U N T I M E _ I N C L U D E _ D I R } / c o r e / g r a p h / * . h "
" $ { O N N X R U N T I M E _ R O O T } / c o r e / g r a p h / * . h "
" $ { O N N X R U N T I M E _ R O O T } / c o r e / g r a p h / * . c c "
)
file ( GLOB_RECURSE onnxruntime_ir_defs_src
" $ { O N N X R U N T I M E _ R O O T } / c o r e / d e f s / * . c c "
)
add_library ( onnxruntime_graph ${ onnxruntime_graph_src } ${ onnxruntime_ir_defs_src } )
add_dependencies ( onnxruntime_graph onnx_proto gsl )
2019-01-18 20:28:13 +00:00
onnxruntime_add_include_to_target ( onnxruntime_graph onnxruntime_common gsl onnx onnx_proto protobuf::libprotobuf )
2018-11-20 00:48:22 +00:00
target_include_directories ( onnxruntime_graph PRIVATE ${ ONNXRUNTIME_ROOT } )
set_target_properties ( onnxruntime_graph PROPERTIES FOLDER "ONNXRuntime" )
set_target_properties ( onnxruntime_graph PROPERTIES LINKER_LANGUAGE CXX )
2018-11-23 04:56:43 +00:00
install ( DIRECTORY ${ PROJECT_SOURCE_DIR } /../include/onnxruntime/core/graph DESTINATION ${ CMAKE_INSTALL_INCLUDEDIR } /onnxruntime/core )
2018-11-20 00:48:22 +00:00
source_group ( TREE ${ REPO_ROOT } FILES ${ onnxruntime_graph_src } ${ onnxruntime_ir_defs_src } )
if ( WIN32 )
set ( onnxruntime_graph_static_library_flags
- I G N O R E : 4 2 2 1 # LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
)
set_target_properties ( onnxruntime_graph PROPERTIES
S T A T I C _ L I B R A R Y _ F L A G S " $ { o n n x r u n t i m e _ g r a p h _ s t a t i c _ l i b r a r y _ f l a g s } " )
target_compile_options ( onnxruntime_graph PRIVATE
/ E H s c # exception handling - C++ may throw, extern "C" will not
)
# Add Code Analysis properties to enable C++ Core checks. Have to do it via a props file include.
set_target_properties ( onnxruntime_graph PROPERTIES VS_USER_PROPS ${ PROJECT_SOURCE_DIR } /EnableVisualStudioCodeAnalysis.props )
endif ( )