diff options
author | Sven Gothel <[email protected]> | 2019-04-12 08:39:19 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2019-04-12 08:39:19 +0200 |
commit | 52cc68870604e406a7225d23f563ae035299dadc (patch) | |
tree | 5d48fd0a9a96069de0d67a08be0a36a52b31f980 /doc | |
parent | ca7f0fb61b0a608b6e684a5bbde71f6ecb6e3fe0 (diff) | |
parent | 8b1e9185aedc070b5f6cddfe361f54dc5d310eec (diff) |
Merge remote-tracking branch 'xranby/robovm'
Diffstat (limited to 'doc')
-rw-r--r-- | doc/misc/robovm.txt | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/doc/misc/robovm.txt b/doc/misc/robovm.txt new file mode 100644 index 000000000..a7099752f --- /dev/null +++ b/doc/misc/robovm.txt @@ -0,0 +1,58 @@ +#get jogamp and robovm +wget https://libgdx.badlogicgames.com/robovm/robovm-1.6.1-SNAPSHOT.tar.gz +wget http://jogamp.org/deployment/jogamp-current/fat/jogamp-fat.jar + +#unpack +tar zxvf robovm-1.6.1-SNAPSHOT.tar.gz + +#compile using robovm +./robovm-1.6.1-SNAPSHOT/bin/robovm -verbose -dynamic-jni -forcelinkclasses jogamp.**:com.jogamp.** -cp jogamp-fat.jar com.jogamp.newt.opengl.GLWindow + +#run +cd com.jogamp.newt.opengl.GLWindow +#robovm currently fail to find natives inside jars, unpack them +unzip -o lib/jogamp-fat.jar natives/*/* +time ./com.jogamp.newt.opengl.GLWindow + + + +# Runtime options +# All robovm runtimeoptions starts with +# -rvm: +# +# To set jogamp specific java properties use +# -rvm:Djogamp.debug +# -rvm:Djogl.debug +# +# for more rvm flag examples see +# https://github.com/robovm/robovm/wiki/Hacking-on-RoboVM#controlling-a-robovm-executable +time ./com.jogamp.newt.opengl.GLWindow -rvm:Djogl.debug + + +# Make the generated robovm binary smaller +# we can use the robovm -treeshaker aggressive to remove classes from the binary +# and we can more carefully select which nativewindow backends to include using forcelinkclasses. +# finally we can reduce the size using strip and upx +./robovm-1.6.1-SNAPSHOT/bin/robovm -treeshaker aggressive -verbose -dynamic-jni -forcelinkclasses jogamp.nativewindow.x11.X11GraphicsConfigurationFactory:jogamp.** -cp jogamp-fat.jar com.jogamp.newt.opengl.GLWindow +cd com.jogamp.newt.opengl.GLWindow +strip com.jogamp.newt.opengl.GLWindow +upx com.jogamp.newt.opengl.GLWindow +# the final binary is then below 5Mb! +# du -s -h com.jogamp.newt.opengl.GLWindow +# 4,7M com.jogamp.newt.opengl.GLWindow + + + +# Real world example using jogl-demos compressed to small size: 6,3Mb +wget http://jogamp.org/deployment/jogamp-current/archive/jogl-demos.7z +7z x jogl-demos.7z +./robovm-1.6.1-SNAPSHOT/bin/robovm -treeshaker aggressive -verbose -dynamic-jni -forcelinkclasses jogamp.nativewindow.x11.X11GraphicsConfigurationFactory:jogamp.** -cp jogamp-fat.jar:jogl-demos/jar/jogl-demos.jar demos.es2.RawGL2ES2demo +cd demos.es2.RawGL2ES2demo +unzip -o lib/jogamp-fat.jar natives/*/* +zip -d lib/jogamp-fat.jar natives/*/* +strip demos.es2.RawGL2ES2demo +upx demos.es2.RawGL2ES2demo +chmod +x natives/*/* +strip natives/*/* +upx natives/*/* +./demos.es2.RawGL2ES2demo |