-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e4bd4e8
commit df95a25
Showing
2 changed files
with
8 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,6 +102,9 @@ def _build_aar(args): | |
|
||
if qnn_android_build: | ||
qnn_home = os.getenv("QNN_HOME") | ||
qnn_sdk_version = os.getenv("QNN_SDK_VERSION") | ||
if not qnn_sdk_version: | ||
raise EnvironmentError("QNN_SDK_VERSION environment variable is not set.") | ||
Check warning Code scanning / lintrunner RUFF/UP024 Warning
Replace aliased errors with OSError.
See https://docs.astral.sh/ruff/rules/os-error-alias |
||
abi_build_command += ["--qnn_home=" + qnn_home] | ||
if ops_config_path is not None: | ||
abi_build_command += ["--include_ops_by_config=" + ops_config_path] | ||
|
@@ -163,6 +166,10 @@ def _build_aar(args): | |
("-DaddQnnDependency=1" if qnn_android_build else "-DaddQnnDependency=0"), | ||
] | ||
|
||
# Add qnn specific parameters | ||
if qnn_android_build: | ||
gradle_command.append(f"-DqnnVersion={qnn_sdk_version}") | ||
|
||
# clean, build, and publish to a local directory | ||
subprocess.run([*gradle_command, "clean"], env=temp_env, shell=False, check=True, cwd=JAVA_ROOT) | ||
subprocess.run([*gradle_command, "build"], env=temp_env, shell=False, check=True, cwd=JAVA_ROOT) | ||
|