Skip to content

Commit 7fc6235

Browse files
authored
[build] fix build on mac (microsoft#25270)
### Description Fixes build on macOS. always include `"core/graph/onnx_protobuf.h"` before including other onnx/protobuf headers. ``` .../build/MacOS/Debug/_deps/protobuf-src/src/google/protobuf/parse_context.h:328:47: error: implicit conversion loses integer precision: 'long' to 'int' [-Werror,-Wshorten-64-to-32] 328 | int chunk_size = buffer_end_ + kSlopBytes - ptr; | ~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ ```
1 parent a092468 commit 7fc6235

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

onnxruntime/test/framework/function_test.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "gtest/gtest.h"
55

6+
#include "core/graph/onnx_protobuf.h"
67
#include "onnx/defs/parser.h"
78

89
#include "core/common/span_utils.h"

onnxruntime/test/optimizer/graph_transform_test.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010
#include "gtest/gtest.h"
1111
#include "gmock/gmock.h"
12+
13+
#include "core/graph/onnx_protobuf.h"
14+
1215
#include "onnx/defs/parser.h"
1316
#include "onnx/defs/printer.h"
1417

@@ -18,7 +21,6 @@
1821
#include "core/graph/graph_utils.h"
1922
#include "core/graph/graph_viewer.h"
2023
#include "core/graph/model.h"
21-
#include "core/graph/onnx_protobuf.h"
2224
#include "core/mlas/inc/mlas_q4.h"
2325
#include "core/optimizer/attention_fusion.h"
2426
#include "core/optimizer/bias_dropout_fusion.h"

onnxruntime/test/optimizer/layout_transformation_potentially_added_ops_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#include "gtest/gtest.h"
77

8-
#include "onnx/defs/schema.h"
8+
#include "core/graph/onnx_protobuf.h"
99

1010
#include "core/graph/constants.h"
1111

0 commit comments

Comments
 (0)