Skip to content

Commit

Permalink
Add windows JNI support (#44257)
Browse files Browse the repository at this point in the history
Summary:
Fixes #32516

Pull Request resolved: #44257

Reviewed By: malfet

Differential Revision: D24332820

Pulled By: ezyang

fbshipit-source-id: 1dd97e9c8140129a02a9078623b190b33f30d5b0
  • Loading branch information
Elijah Rippeth authored and facebook-github-bot committed Oct 15, 2020
1 parent bd44933 commit b547973
Show file tree
Hide file tree
Showing 5 changed files with 1,162 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .circleci/scripts/binary_populate_env.sh
Expand Up @@ -100,8 +100,14 @@ if [[ "$PACKAGE_TYPE" == libtorch ]]; then
POSSIBLE_JAVA_HOMES+=(/usr/local)
POSSIBLE_JAVA_HOMES+=(/usr/lib/jvm/java-8-openjdk-amd64)
POSSIBLE_JAVA_HOMES+=(/Library/Java/JavaVirtualMachines/*.jdk/Contents/Home)
# Add the Windows-specific JNI path
POSSIBLE_JAVA_HOMES+=("$PWD/.circleci/windows-jni/")
for JH in "${POSSIBLE_JAVA_HOMES[@]}" ; do
if [[ -e "$JH/include/jni.h" ]] ; then
# Skip if we're not on Windows but haven't found a JAVA_HOME
if [[ "$JH" == "$PWD/.circleci/windows-jni/" && "$OSTYPE" != "msys" ]] ; then
break
fi
echo "Found jni.h under $JH"
JAVA_HOME="$JH"
BUILD_JNI=ON
Expand Down

0 comments on commit b547973

Please sign in to comment.