OS X: use JavaVM framework from current Mac OS SDK

This commit is contained in:
Max Smolens 2015-02-25 22:32:12 -05:00
parent 9e60152dc5
commit 6fa4980b1b
1 changed files with 4 additions and 3 deletions

View File

@ -44,12 +44,13 @@ if platform == 'android':
libraries = ['sdl', 'log'] libraries = ['sdl', 'log']
library_dirs = ['libs/' + environ['ARCH']] library_dirs = ['libs/' + environ['ARCH']]
elif platform == 'darwin': elif platform == 'darwin':
import objc import subprocess
framework = objc.pathForFramework('JavaVM.framework') framework = subprocess.Popen('xcrun --sdk macosx --show-sdk-path',
shell=True, stdout=subprocess.PIPE).communicate()[0].strip()
if not framework: if not framework:
raise Exception('You must install Java on your Mac OS X distro') raise Exception('You must install Java on your Mac OS X distro')
extra_link_args = ['-framework', 'JavaVM'] extra_link_args = ['-framework', 'JavaVM']
include_dirs = [join(framework, 'Versions/A/Headers')] include_dirs = [join(framework, 'System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers')]
else: else:
import subprocess import subprocess
# otherwise, we need to search the JDK_HOME # otherwise, we need to search the JDK_HOME