@@ -7,8 +7,26 @@ file(GLOB_RECURSE onnxruntime_graph_src CONFIGURE_DEPENDS
7
7
"${ONNXRUNTIME_ROOT} /core/graph/*.cc"
8
8
)
9
9
10
- # create empty list for any excludes
10
+ # start with empty training srcs list
11
+ set (orttraining_graph_src)
12
+
13
+ if (onnxruntime_ENABLE_TRAINING_OPS AND NOT onnxruntime_ENABLE_TRAINING)
14
+ set (orttraining_graph_src
15
+ "${ORTTRAINING_SOURCE_DIR} /core/graph/training_op_defs.cc"
16
+ "${ORTTRAINING_SOURCE_DIR} /core/graph/training_op_defs.h"
17
+ )
18
+ endif ()
19
+
20
+ if (onnxruntime_ENABLE_TRAINING)
21
+ file (GLOB_RECURSE orttraining_graph_src CONFIGURE_DEPENDS
22
+ "${ORTTRAINING_SOURCE_DIR} /core/graph/*.h"
23
+ "${ORTTRAINING_SOURCE_DIR} /core/graph/*.cc"
24
+ )
25
+ endif ()
26
+
27
+ # create empty lists for any excludes
11
28
set (onnxruntime_graph_src_exclude_patterns)
29
+ set (orttraining_graph_src_exclude_patterns)
12
30
13
31
if (onnxruntime_MINIMAL_BUILD)
14
32
# remove schema registration support
@@ -22,11 +40,18 @@ if (onnxruntime_MINIMAL_BUILD)
22
40
"${ONNXRUNTIME_ROOT} /core/graph/contrib_ops/onnx_function_util.cc"
23
41
"${ONNXRUNTIME_ROOT} /core/graph/contrib_ops/shape_inference_functions.h"
24
42
"${ONNXRUNTIME_ROOT} /core/graph/contrib_ops/shape_inference_functions.cc"
43
+ "${ONNXRUNTIME_ROOT} /core/graph/dml_ops/dml_defs.h"
44
+ "${ONNXRUNTIME_ROOT} /core/graph/dml_ops/dml_defs.cc"
25
45
"${ONNXRUNTIME_ROOT} /core/graph/function_template.h"
26
46
"${ONNXRUNTIME_ROOT} /core/graph/function_utils.h"
27
47
"${ONNXRUNTIME_ROOT} /core/graph/function_utils.cc"
28
48
)
29
49
50
+ list (APPEND orttraining_graph_src_exclude_patterns
51
+ "${ORTTRAINING_SOURCE_DIR} /core/graph/training_op_defs.h"
52
+ "${ORTTRAINING_SOURCE_DIR} /core/graph/training_op_defs.cc"
53
+ )
54
+
30
55
# no Function support initially
31
56
list (APPEND onnxruntime_graph_src_exclude_patterns
32
57
"${ONNXRUNTIME_ROOT} /core/graph/function*"
@@ -64,30 +89,12 @@ endif()
64
89
file (GLOB onnxruntime_graph_src_exclude ${onnxruntime_graph_src_exclude_patterns} )
65
90
list (REMOVE_ITEM onnxruntime_graph_src ${onnxruntime_graph_src_exclude} )
66
91
67
- file (GLOB_RECURSE onnxruntime_ir_defs_src CONFIGURE_DEPENDS
68
- "${ONNXRUNTIME_ROOT} /core/defs/*.cc"
69
- )
70
-
71
- if (onnxruntime_ENABLE_TRAINING_OPS AND NOT onnxruntime_ENABLE_TRAINING)
72
- set (orttraining_graph_src
73
- "${ORTTRAINING_SOURCE_DIR} /core/graph/training_op_defs.cc"
74
- "${ORTTRAINING_SOURCE_DIR} /core/graph/training_op_defs.h"
75
- )
76
- endif ()
77
-
78
- if (onnxruntime_ENABLE_TRAINING)
79
- file (GLOB_RECURSE orttraining_graph_src CONFIGURE_DEPENDS
80
- "${ORTTRAINING_SOURCE_DIR} /core/graph/*.h"
81
- "${ORTTRAINING_SOURCE_DIR} /core/graph/*.cc"
82
- )
83
- endif ()
84
-
85
- set (onnxruntime_graph_lib_src ${onnxruntime_graph_src} ${onnxruntime_ir_defs_src} )
86
92
if (onnxruntime_ENABLE_TRAINING_OPS)
87
- list (APPEND onnxruntime_graph_lib_src ${orttraining_graph_src} )
93
+ file (GLOB orttraining_graph_src_exclude ${orttraining_graph_src_exclude_patterns} )
94
+ list (REMOVE_ITEM orttraining_graph_src ${orttraining_graph_src_exclude} )
88
95
endif ()
89
96
90
- onnxruntime_add_static_library(onnxruntime_graph ${onnxruntime_graph_lib_src } )
97
+ onnxruntime_add_static_library(onnxruntime_graph ${onnxruntime_graph_src} ${orttraining_graph_src } )
91
98
add_dependencies (onnxruntime_graph onnx_proto flatbuffers::flatbuffers)
92
99
onnxruntime_add_include_to_target(onnxruntime_graph onnxruntime_common ${WIL_TARGET} onnx onnx_proto ${PROTOBUF_LIB} flatbuffers::flatbuffers safeint_interface Boost::mp11)
93
100
@@ -120,7 +127,7 @@ endif()
120
127
121
128
set_target_properties (onnxruntime_graph PROPERTIES FOLDER "ONNXRuntime" )
122
129
set_target_properties (onnxruntime_graph PROPERTIES LINKER_LANGUAGE CXX)
123
- source_group (TREE ${REPO_ROOT} FILES ${onnxruntime_graph_src} ${onnxruntime_ir_defs_src} )
130
+ source_group (TREE ${REPO_ROOT} FILES ${onnxruntime_graph_src} )
124
131
if (onnxruntime_ENABLE_TRAINING_OPS)
125
132
source_group (TREE ${ORTTRAINING_ROOT} FILES ${orttraining_graph_src} )
126
133
endif ()
0 commit comments