Skip to content

[cmake] Support cross compilation towards Android with Windows host - #2344

Merged
antiagainst merged 2 commits into
iree-org:mainfrom
antiagainst:cmake-win-cross-android
Jun 29, 2020
Merged

antiagainst merged 2 commits into
iree-org:mainfrom
antiagainst:cmake-win-cross-android

Conversation

@antiagainst

@antiagainst antiagainst commented Jun 28, 2020 •

Copy link
Copy Markdown
Member

Using Windows as the host platform for cross compiling IREE towards
Android requires more cmake arguments than Linux. LLVM is having
problem of detecting host triple when CMake is invoked with Android
toolchain file. This means we need to manually pass in certain
configurations to help it figure out the proper compiler toolchain
for host.

This commit also changes various TARGET function parameter names
to EXECUTABLE given that for referencing "targets" on host, which
is under another CMake invocation, we need to relying on the generated
executable artifacts. Using EXECUTABLE is more clear.

Using Windows as the host platform for cross compiling IREE towards
Android requires more cmake arguments than Linux. LLVM is having
problem of detecting host triple when CMake is invoked with Android
toolchain file. This means we need to manually pass in certain
configurations to help it figure out the proper compiler toolchain
for host.
@antiagainst
antiagainst force-pushed the cmake-win-cross-android branch from 5f382e3 to eac4c86 Compare June 29, 2020 17:50

@ScottTodd ScottTodd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't comment on the lines (why, GitHub??), but

getting_started_android_cmake.md

  • iree-translate line in shouldn't have a leading -- (that's for bazel run ... commands)
  • adb push build-android/iree/tools/iree-run-module
  • needed to chmod +x iree-run-module, otherwise "Permission denied" (unrooted Galaxy S10)

otherwise the steps worked for me and I was able to get the i32=5 result :D

@antiagainst

Copy link
Copy Markdown
Member Author
  • iree-translate line in shouldn't have a leading -- (that's for bazel run ... commands)
  • adb push build-android/iree/tools/iree-run-module
  • needed to chmod +x iree-run-module, otherwise "Permission denied" (unrooted Galaxy S10)

Done.

@antiagainst
antiagainst merged commit 5e88832 into iree-org:main Jun 29, 2020
@antiagainst
antiagainst deleted the cmake-win-cross-android branch June 29, 2020 20:17
This was referenced Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants