From f88f3ed170ee2fd2f79c1ec0ab9aa8671c151664 Mon Sep 17 00:00:00 2001 From: Len Boyette Date: Sun, 24 Nov 2013 21:54:07 -0500 Subject: [PATCH] Compile in Windows successfully Fixed jvm.lib reference --- jnius/jnius_jvm_desktop.pxi | 2 +- setup.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/jnius/jnius_jvm_desktop.pxi b/jnius/jnius_jvm_desktop.pxi index 114647a..c20ed09 100644 --- a/jnius/jnius_jvm_desktop.pxi +++ b/jnius/jnius_jvm_desktop.pxi @@ -1,7 +1,7 @@ # on desktop, we need to create an env :) # example taken from http://www.inonit.com/cygwin/jni/invocationApi/c.html -cdef extern jint JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *args) +cdef extern jint __stdcall JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *args) cdef extern from "jni.h": int JNI_VERSION_1_4 jboolean JNI_FALSE diff --git a/setup.py b/setup.py index b8f7aee..a513b50 100644 --- a/setup.py +++ b/setup.py @@ -68,10 +68,16 @@ else: if not jre_home: raise Exception('Unable to determine JRE_HOME') cpu = 'i386' if sys.maxint == 2147483647 else 'amd64' + include_dirs = [ join(jdk_home, 'include'), join(jdk_home, 'include', platform)] - library_dirs = [join(jre_home, 'lib', cpu, 'server')] + if platform == 'win32': + library_dirs = [ + join(jdk_home, 'lib'), + join(jre_home, 'bin', 'server')] + else: + library_dirs = [join(jre_home, 'lib', cpu, 'server')] extra_link_args = ['-Wl,-rpath', library_dirs[0]] libraries = ['jvm']