mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-29 20:14:01 +00:00
Allow --cmake_generator to work on macOS (#4278)
This commit is contained in:
parent
15c07c75f8
commit
64264c3846
1 changed files with 11 additions and 5 deletions
|
|
@ -314,7 +314,7 @@ def parse_arguments():
|
|||
parser.add_argument(
|
||||
"--cmake_generator",
|
||||
choices=['Visual Studio 15 2017', 'Visual Studio 16 2019', 'Ninja'],
|
||||
default='Visual Studio 15 2017',
|
||||
default='Visual Studio 15 2017' if is_windows() else None,
|
||||
help="Specify the generator that CMake invokes. "
|
||||
"This is only supported on Windows")
|
||||
parser.add_argument(
|
||||
|
|
@ -692,8 +692,11 @@ def generate_build_tree(cmake_path, source_dir, build_dir, cuda_home, cudnn_home
|
|||
"-DANDROID_ABI=" + str(args.android_abi)
|
||||
]
|
||||
|
||||
if is_macOS() and args.use_xcode:
|
||||
cmake_args += ["-GXcode"]
|
||||
if is_macOS():
|
||||
if args.use_xcode:
|
||||
cmake_args += ['-G', 'Xcode']
|
||||
elif args.cmake_generator is not None:
|
||||
cmake_args += ['-G', args.cmake_generator]
|
||||
|
||||
if args.ios:
|
||||
if is_macOS():
|
||||
|
|
@ -1513,8 +1516,11 @@ def build_protoc_for_host(cmake_path, source_dir, build_dir, args):
|
|||
if not is_ninja:
|
||||
cmd_args += ['-T', 'host=x64']
|
||||
cmd_args += ['-G', args.cmake_generator]
|
||||
elif is_macOS() and args.use_xcode:
|
||||
cmd_args += ['-G', 'Xcode']
|
||||
elif is_macOS():
|
||||
if args.use_xcode:
|
||||
cmd_args += ['-G', 'Xcode']
|
||||
elif args.cmake_generator is not None:
|
||||
cmd_args += ['-G', args.cmake_generator]
|
||||
|
||||
run_subprocess(cmd_args, cwd=protoc_build_dir)
|
||||
# Build step
|
||||
|
|
|
|||
Loading…
Reference in a new issue