mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-31 23:27:43 +00:00
Fix possible ios build break after update to Xcode 12 (#5246)
* Fix possible ios build break after update to Xcode 12 * Address comments
This commit is contained in:
parent
417929b049
commit
d957dbebea
3 changed files with 8 additions and 2 deletions
|
|
@ -581,7 +581,7 @@ Status Node::LoadFromOrtFormat(const onnxruntime::experimental::fbs::Node& fbs_n
|
|||
bool check_parent_graph = false) -> Status {
|
||||
ORT_RETURN_IF(nullptr == fbs_node_arg_names, "fbs_node_arg_names cannot be null");
|
||||
node_args.reserve(fbs_node_arg_names->size());
|
||||
for (const auto& node_arg_name : *fbs_node_arg_names) {
|
||||
for (const auto* node_arg_name : *fbs_node_arg_names) {
|
||||
ORT_RETURN_IF(nullptr == node_arg_name, "node_arg_name cannot be null");
|
||||
auto* node_arg = check_parent_graph ? graph_->GetNodeArgIncludingParentGraphs(node_arg_name->str())
|
||||
: graph_->GetNodeArg(node_arg_name->str());
|
||||
|
|
|
|||
|
|
@ -292,7 +292,7 @@ Status LoadInitializerOrtFormat(const fbs::Tensor& fbs_tensor,
|
|||
ORT_RETURN_IF(nullptr == fbs_str_data, "Missing string data for initializer. Invalid ORT format model.");
|
||||
auto mutable_str_data = initializer.mutable_string_data();
|
||||
mutable_str_data->Reserve(fbs_str_data->size());
|
||||
for (const auto& fbs_str : *fbs_str_data) {
|
||||
for (const auto* fbs_str : *fbs_str_data) {
|
||||
mutable_str_data->Add(fbs_str->str());
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1547,6 +1547,12 @@ def build_protoc_for_host(cmake_path, source_dir, build_dir, args):
|
|||
elif is_macOS():
|
||||
if args.use_xcode:
|
||||
cmd_args += ['-G', 'Xcode']
|
||||
# CMake < 3.18 has a bug setting system arch to arm64 (if not specified) for Xcode 12,
|
||||
# protoc for host should be built using host architecture
|
||||
# Explicitly specify the CMAKE_OSX_ARCHITECTURES for x86_64 Mac.
|
||||
import platform
|
||||
if platform.machine() == 'x86_64':
|
||||
cmd_args += ['-DCMAKE_OSX_ARCHITECTURES=x86_64']
|
||||
|
||||
run_subprocess(cmd_args, cwd=protoc_build_dir)
|
||||
# Build step
|
||||
|
|
|
|||
Loading…
Reference in a new issue