No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer



最近のWikiの更新 (Recent Changes)

No changes on this wiki.


サイドバー (Side Bar)


  • R/O
  • R/O (HTTP)
  • R/W (SSH)
  • R/W (HTTPS)

Release Files

No download files.

Recent Commits

Rev.TiempoAutorMensaje RSS
ce352ceb2024-01-18 04:10:02Hotshot5000Removed x86_64 and simulator builds since we only use a d...
5c48cc492023-11-15 05:53:00Hotshot5000Changed build-ios.xml to build only for arm
9d7dc9152023-11-15 04:23:11Hotshot5000Using shadowJar in order to build fat jars.
e6873a882023-11-09 06:16:22PokeMMO Merge pull request #48 from SimonIT/riscv feat: Introdu...
2dfd0f862023-11-09 04:39:51SimonITdoc: Add replacement information for *is*-fields in Share...
49f1e8ad2023-11-09 04:38:03SimonITfix: Add missing add method to JnigenExtension
875160cb2023-11-08 02:00:41SimonITfeat: Move enums to loader
9d0e32142023-10-23 19:48:20SimonITfix: Deprecate also get
b3fb59b22023-10-23 19:39:58SimonITMerge branch 'master' into riscv
4c8732df2023-10-19 00:07:53PokeMMO Merge pull request #47 from SimonIT/gradle-upgrade chor...


Build Status

The gdx-jnigen tool can be used with or without libGDX to allow C/C++ code to be written inline with Java source code.

This increases the locality of code that conceptually belongs together (the Java native class methods and the actual implementation) and makes refactoring a lot easier compared to the usual JNI workflow. Arrays and direct buffers are converted for you, further reducing boilerplate. Building the natives for Windows, Linux, macOS, and Android and iOS is handled for you. jnigen also provides a mechanism for loading native libraries from a JAR at runtime, which avoids "java.library.path" troubles.

See the libGDX Wiki for usage: https://libgdx.com/wiki/utils/jnigen

gdx-jnigen-gradle quickstart

We recommend you look at some existing projects for examples: - gdx - gdx-freetype - gdx-bullet - gdx-video-desktop - Jamepad

// Add buildscript dependency
buildscript {
    dependencies {
        classpath "com.badlogicgames.gdx:gdx-jnigen-gradle:2.X.X"

// Apply jnigen plugin
apply plugin: "com.badlogicgames.gdx.gdx-jnigen"


// Define jnigen extension
jnigen {
    // Your shared library name
    sharedLibName = "example"
    //temporaryDir = "target"
    //libsDir = "libs"
    //jniDir = "jni"

    // Shared configuration for all BuildTargets. Executed first
    // See all BuildTarget options here: https://github.com/libgdx/gdx-jnigen/blob/master/gdx-jnigen/src/main/java/com/badlogic/gdx/jnigen/BuildTarget.java
    // Most paths are relative to the $jniDir directory
    // String options can be replaced by using `x = "value"` or appended to with `x += "extravalue"`
    // String[] options can be replaced by using `x = ["value"]` or appended to with `x += "extravalue"` or `x += ["extravalue", "extravalue2"]`
    all {
        // Add extra flags passed to the C compiler
        cFlags += " -fvisibility=hidden "
        // Add extra flags passed to the C++ compiler
        cppFlags += " -std=c++11 -fvisibility=hidden "
        // Add extra flags passed to the linker
        linkerFlags += " -fvisibility=hidden "

    // Configure robovm.xml for IOS builds, most simple libraries will not need to do this
    robovm {
        // Use preexisting robovm.xml, cannot be combined with other options.
        //manualFile file("robovm.xml")

        // Add extra patterns to forceLinkClasses
        //forceLinkClasses "test", "test2"
        //forceLinkClasses "pattern3"
        // Add extra library "test.a" with variant "device"
        //extraLib "test.a", "device"
        //extraXCFramework "libs/test.xcframework"

    // Add BuildTargets
    // All BuildTarget options can be further customized in an OS+Arch specific manner within a {} block

    // Add windows 32-bit BuildTarget and customize it
    add(Windows, x32) {
        //cFlags += " -fextraflag=fake "
        //compilerPrefix = "someprefix-";
        //cIncludes += "windowsspecificdir/*.c"
    add(Windows, x64)
    add(Linux, x32)
    add(Linux, x64)
    add(Linux, x32, ARM)
    add(Linux, x64, ARM)
    add(MacOsX, x64)
    add(MacOsX, x64, ARM)
    add(Android) {
        // Add extra content to the generated Application.mk file
        //androidApplicationMk += "APP_STL := c++_static"
        // Specify which ABIs to build
        //androidABIs = ["armeabi", "armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
    add(IOS) {
        // Define ios framework bundle identifier
        // xcframeworkBundleIdentifier = "com.badlogic.gdx.JniGen
        // Deinfe minimum supported iOS version
        // minIOSVersion = "11.0"

    // Customize each BuildTarget that matches the condition
    each({ it.os != Android && !it.isARM }) {
        //cppFlags += " -march=nocona "
    // Customize everything again, can be used for conditional changes
    each({ true }) {
        //if(!it.cppCompiler.contains("clang")) {
        //    it.cFlags += " -flto "
        //    it.cppFlags += " -flto "
        //    it.linkerFlags += " -flto "

        //    it.linkerFlags += " -Wl,-dead_strip -Wl,-s "
        //    it.linkerFlags += " -Wl,--gc-sections "

Latest updated Tickets

No tickets

About Chamber Wiki

Welcome to OSDN Wiki system. Here is your chamber Wiki space.

Check Wiki Guide (English) to refer syntax and functions.