Skip to content

Commit

Permalink
Enable the build for RISC-V architecture
Browse files Browse the repository at this point in the history
Reviewed-by: Alan Kao <[email protected]>
  • Loading branch information
CNOCycle committed Oct 26, 2023
1 parent 7c0b3bc commit 50c35c2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools/ci_build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,11 @@ def convert_arg_line_to_args(self, arg_line):
help="[cross-compiling] Create ARM64EC makefiles. Requires --update and no existing cache "
"CMake setup. Delete CMakeCache.txt if needed",
)
parser.add_argument("--riscv",
action='store_true',
help="[cross-compiling] Create RISC-V makefiles. Requires --update and no existing cache "
"CMake setup. Delete CMakeCache.txt if needed",
)
parser.add_argument("--msvc_toolset", help="MSVC toolset to use. e.g. 14.11")
parser.add_argument("--windows_sdk_version", help="Windows SDK version to use. e.g. 10.0.19041.0")
parser.add_argument("--android", action="store_true", help="Build for Android")
Expand Down Expand Up @@ -1054,7 +1059,7 @@ def generate_build_tree(

# By default on Windows we currently support only cross compiling for ARM/ARM64
# (no native compilation supported through this script).
if args.arm64 or args.arm64ec or args.arm:
if args.arm64 or args.arm64ec or args.arm or args.riscv:
add_default_definition(cmake_extra_defines, "onnxruntime_CROSS_COMPILING", "ON")
if args.use_extensions:
add_default_definition(cmake_extra_defines, "OPENCV_SKIP_SYSTEM_PROCESSOR_DETECTION", "ON")
Expand Down

0 comments on commit 50c35c2

Please sign in to comment.