[Build] Drop 32bit support
This commit is contained in:
1 parent
b4df8d8611
commit
39a86991f2
10 files changed
+56
-98
No files matched your search
@@ -22,34 +22,24 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
type: [win32, win64, linux32, linux64, mac64]
|
||||
type: [win, linux, mac]
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
type: win32
|
||||
expected: imgui-binding/build/libsNative/windows32/imgui-java.dll
|
||||
type: win
|
||||
expected: /tmp/imgui/libsNative/windows64/imgui-java64.dll
|
||||
- os: ubuntu-latest
|
||||
type: win64
|
||||
expected: imgui-binding/build/libsNative/windows64/imgui-java64.dll
|
||||
- os: ubuntu-latest
|
||||
type: linux32
|
||||
expected: imgui-binding/build/libsNative/linux32/libimgui-java.so
|
||||
- os: ubuntu-latest
|
||||
type: linux64
|
||||
expected: imgui-binding/build/libsNative/linux64/libimgui-java64.so
|
||||
type: linux
|
||||
expected: /tmp/imgui/libsNative/linux64/libimgui-java64.so
|
||||
- os: macos-latest
|
||||
type: mac64
|
||||
expected: imgui-binding/build/libsNative/macosx64/libimgui-java64.dylib
|
||||
type: mac
|
||||
expected: /tmp/imgui/libsNative/macosx64/libimgui-java64.dylib
|
||||
exclude:
|
||||
- os: ubuntu-latest
|
||||
type: mac64
|
||||
type: mac
|
||||
- os: macos-latest
|
||||
type: win32
|
||||
type: win
|
||||
- os: macos-latest
|
||||
type: win64
|
||||
- os: macos-latest
|
||||
type: linux32
|
||||
- os: macos-latest
|
||||
type: linux64
|
||||
type: linux
|
||||
name: Build Natives [${{ matrix.os }}]-[${{ matrix.type }}]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
@@ -69,9 +59,8 @@ jobs:
|
||||
- name: Build [${{ matrix.type }}]
|
||||
uses: eskatos/gradle-command-action@v1
|
||||
with:
|
||||
arguments: :imgui-binding:generateLibs -Denvs=${{ matrix.type }} -Dlocal
|
||||
arguments: :imgui-binding:generateLibs -Denvs=${{ matrix.type }}
|
||||
- name: Check [${{ matrix.expected }}]
|
||||
uses: andstor/file-existence-action@v1
|
||||
with:
|
||||
files: ${{ matrix.expected }}
|
||||
|
||||
@@ -137,13 +137,11 @@ You can refer to [imgui-app](https://github.com/SpaiR/imgui-java/blob/v1.82.2/im
|
||||
For simplicity, example of dependencies for Gradle/Maven only shows how to add natives for Windows.
|
||||
Feel free to add other platforms.
|
||||
|
||||
| Native Binaries | System |
|
||||
| ------------------------------ | ------------- |
|
||||
| imgui-java-natives-windows-x86 | Windows 32bit |
|
||||
| imgui-java-natives-windows | Windows 64bit |
|
||||
| imgui-java-natives-linux-x86 | Linux 32bit |
|
||||
| imgui-java-natives-linux | Linux 64bit |
|
||||
| imgui-java-natives-macos | MacOS |
|
||||
| Native Binaries | System |
|
||||
| ------------------------------ | ------- |
|
||||
| imgui-java-natives-windows | Windows |
|
||||
| imgui-java-natives-linux | Linux |
|
||||
| imgui-java-natives-macos | MacOS |
|
||||
|
||||
Take a note, that you also need to add dependencies to [LWJGL](https://www.lwjgl.org/). Examples below shows how to do it as well.
|
||||
|
||||
@@ -250,10 +248,8 @@ dependencies {
|
||||
|
||||
1. Go to the [release page](https://github.com/SpaiR/imgui-java/releases/latest);
|
||||
2. Download `imgui-binding-${version}.jar`, `imgui-lwjgl3-${version}.jar` and binary libraries for your OS;
|
||||
- imgui-java.dll - Windows 32bit
|
||||
- imgui-java64.dll - Windows 64bit
|
||||
- libimgui-java.so - Linux 32bit
|
||||
- libimgui-java64.so - Linux 64bit
|
||||
- imgui-java64.dll - Windows
|
||||
- libimgui-java64.so - Linux
|
||||
- libimgui-java64.dylib - MacOS
|
||||
3. Add jars to your classpath;
|
||||
4. Provide a VM option: `imgui.library.path` or `java.library.path`. It should point to the folder where you've placed downloaded native libraries.
|
||||
@@ -285,13 +281,11 @@ Don't forget to make clear for your Linux/Mac users, that they will need to inst
|
||||
- Maven/Gradle:<br>
|
||||
Use the same native libraries as you would, but with `-ft` suffix in the end.
|
||||
|
||||
| Native Binaries With FreeType | System |
|
||||
| --------------------------------- | ------------- |
|
||||
| imgui-java-natives-windows-x86-ft | Windows 32bit |
|
||||
| imgui-java-natives-windows-ft | Windows 64bit |
|
||||
| imgui-java-natives-linux-x86-ft | Linux 32bit |
|
||||
| imgui-java-natives-linux-ft | Linux 64bit |
|
||||
| imgui-java-natives-macos-ft | MacOS |
|
||||
| Native Binaries With FreeType | System |
|
||||
| --------------------------------- | ------- |
|
||||
| imgui-java-natives-windows-ft | Windows |
|
||||
| imgui-java-natives-linux-ft | Linux |
|
||||
| imgui-java-natives-macos-ft | MacOS |
|
||||
<details>
|
||||
<summary><b>Modified Gradle Example</b></summary>
|
||||
|
||||
@@ -339,20 +333,20 @@ Read [javadoc](https://javadoc.io/doc/io.github.spair/imgui-java-binding) and so
|
||||
* Java 8 or higher
|
||||
* Ant
|
||||
* Mingw-w64 (recommended way: use [MSYS2](https://www.msys2.org/) and install [mingw-w64-x86_64-toolchain](https://packages.msys2.org/group/mingw-w64-x86_64-toolchain) group)
|
||||
- Build with: `./gradlew :imgui-binding:generateLibs -Denvs=win64 -Dlocal`
|
||||
- Build with: `./gradlew :imgui-binding:generateLibs -Denvs=win -Dlocal`
|
||||
- Run with: `./gradlew :example:run -PlibPath="../imgui-binding/build/libsNative/windows64"`
|
||||
|
||||
### Linux
|
||||
- Install dependencies: `openjdk8`, `mingw-w64-gcc`, `ant`. (Package names could vary from system to system.)
|
||||
- Build with: `./gradlew :imgui-binding:generateLibs -Denvs=linux64 -Dlocal`
|
||||
- Build with: `./gradlew :imgui-binding:generateLibs -Denvs=linux -Dlocal`
|
||||
- Run with: `./gradlew :example:run -PlibPath=../imgui-binding/build/libsNative/linux64`
|
||||
|
||||
### MacOS
|
||||
- Check dependencies from "Linux" section and make sure you have them installed.
|
||||
- Build with: `./gradlew :imgui-binding:generateLibs -Denvs=mac64 -Dlocal`
|
||||
- Build with: `./gradlew :imgui-binding:generateLibs -Denvs=mac -Dlocal`
|
||||
- Run with: `./gradlew :example:run -PlibPath=../imgui-binding/build/libsNative/macosx64`
|
||||
|
||||
In `envs` parameter next values could be used `win32`, `win64`, `linux32`, `linux64` or `mac64`.<br>
|
||||
In `envs` parameter next values could be used `win`, `linux` or `mac`.<br>
|
||||
`-Dlocal` is optional and means that natives will be built under the `./imgui-binding/build/` folder. Otherwise `/tmp/imgui` folder will be used.
|
||||
On Windows always use local build.
|
||||
|
||||
|
||||
+3
-5
@@ -3,13 +3,11 @@ Folder contains libraries used by the binding.
|
||||
Provide 'imgui.library.path' VM option to the folder with one of those file (ex: -Dimgui.library.path=./some/folder).
|
||||
In the same way you can use 'java.library.path' option instead.
|
||||
|
||||
By default binding expects 'imgui-java' ('imgui-java64' for x64 arch) file name.
|
||||
By default binding expects 'imgui-java64' file name.
|
||||
You can change that by using 'imgui.library.name' VM option (ex: -Dimgui.library.name=custom-lib-name).
|
||||
|
||||
- imgui-java.dll << Windows 32bit
|
||||
- imgui-java64.dll << Windows 64bit
|
||||
- libimgui-java.so << Linux 32bit
|
||||
- libimgui-java64.so << Linux 64bit
|
||||
- imgui-java64.dll << Windows
|
||||
- libimgui-java64.so << Linux
|
||||
- libimgui-java64.dylib << MacOS
|
||||
|
||||
Freetype folder contains same libraries, but with Freetype support.
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -15,11 +15,9 @@ class GenerateLibs extends DefaultTask {
|
||||
String description = 'Generate imgui-java native binaries.'
|
||||
|
||||
private final String[] buildEnvs = System.getProperty('envs')?.split(',')
|
||||
private final boolean forWin32 = buildEnvs?.contains('win32')
|
||||
private final boolean forWin64 = buildEnvs?.contains('win64')
|
||||
private final boolean forLinux32 = buildEnvs?.contains('linux32')
|
||||
private final boolean forLinux64 = buildEnvs?.contains('linux64')
|
||||
private final boolean forMac64 = buildEnvs?.contains('mac64')
|
||||
private final boolean forWindows = buildEnvs?.contains('win')
|
||||
private final boolean forLinux = buildEnvs?.contains('linux')
|
||||
private final boolean forMac = buildEnvs?.contains('mac')
|
||||
|
||||
private final boolean isLocal = System.properties.containsKey("local")
|
||||
private final boolean withFreeType = System.properties.containsKey("freetype")
|
||||
@@ -68,29 +66,19 @@ class GenerateLibs extends DefaultTask {
|
||||
def buildConfig = new BuildConfig('imgui-java', tmpFolder, libsFolder, jniDir)
|
||||
def buildTargets = [] as BuildTarget[]
|
||||
|
||||
if (forWin32) {
|
||||
def win32 = BuildTarget.newDefaultTarget(BuildTarget.TargetOs.Windows, false)
|
||||
addFreeTypeIfEnabled(win32)
|
||||
buildTargets += win32
|
||||
}
|
||||
if (forWin64) {
|
||||
if (forWindows) {
|
||||
def win64 = BuildTarget.newDefaultTarget(BuildTarget.TargetOs.Windows, true)
|
||||
addFreeTypeIfEnabled(win64)
|
||||
buildTargets += win64
|
||||
}
|
||||
|
||||
if (forLinux32) {
|
||||
def linux32 = BuildTarget.newDefaultTarget(BuildTarget.TargetOs.Linux, false)
|
||||
addFreeTypeIfEnabled(linux32)
|
||||
buildTargets += linux32
|
||||
}
|
||||
if (forLinux64) {
|
||||
if (forLinux) {
|
||||
def linux64 = BuildTarget.newDefaultTarget(BuildTarget.TargetOs.Linux, true)
|
||||
addFreeTypeIfEnabled(linux64)
|
||||
buildTargets += linux64
|
||||
}
|
||||
|
||||
if (forMac64) {
|
||||
if (forMac) {
|
||||
def minMacOsVersion = '10.15'
|
||||
def mac64 = BuildTarget.newDefaultTarget(BuildTarget.TargetOs.MacOsX, true)
|
||||
mac64.cppFlags += ' -std=c++14'
|
||||
@@ -107,15 +95,11 @@ class GenerateLibs extends DefaultTask {
|
||||
|
||||
def commonParams = ['-v', '-Dhas-compiler=true', '-Drelease=true', 'clean', 'postcompile'] as String[]
|
||||
|
||||
if (forWin32)
|
||||
BuildExecutor.executeAnt(jniDir + '/build-windows32.xml', commonParams)
|
||||
if (forWin64)
|
||||
if (forWindows)
|
||||
BuildExecutor.executeAnt(jniDir + '/build-windows64.xml', commonParams)
|
||||
if (forLinux32)
|
||||
BuildExecutor.executeAnt(jniDir + '/build-linux32.xml', commonParams)
|
||||
if (forLinux64)
|
||||
if (forLinux)
|
||||
BuildExecutor.executeAnt(jniDir + '/build-linux64.xml', commonParams)
|
||||
if (forMac64)
|
||||
if (forMac)
|
||||
BuildExecutor.executeAnt(jniDir + '/build-macosx64.xml', commonParams)
|
||||
|
||||
BuildExecutor.executeAnt(jniDir + '/build.xml', '-v', 'pack-natives')
|
||||
@@ -126,19 +110,19 @@ class GenerateLibs extends DefaultTask {
|
||||
return
|
||||
}
|
||||
|
||||
if (target.os == BuildTarget.TargetOs.Windows) {
|
||||
if (!target.is64Bit) {
|
||||
target.cppFlags += ' -fstack-protector'
|
||||
}
|
||||
target.libraries += '-lbz2 -lssp'
|
||||
switch (target.os) {
|
||||
case BuildTarget.TargetOs.Windows:
|
||||
target.cppFlags += ' -I/usr/x86_64-w64-mingw32/include/freetype2'
|
||||
break
|
||||
case BuildTarget.TargetOs.Linux:
|
||||
target.cppFlags += ' -I/usr/include/freetype2'
|
||||
break
|
||||
case BuildTarget.TargetOs.MacOsX:
|
||||
target.cppFlags += ' -I/usr/local/include/freetype2'
|
||||
break
|
||||
}
|
||||
|
||||
target.cppFlags += ' -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include'
|
||||
target.libraries += ' -lfreetype'
|
||||
|
||||
if (target.os == BuildTarget.TargetOs.MacOsX) {
|
||||
target.cppFlags.replace('-I/usr/include/', '-I/usr/local/include/')
|
||||
}
|
||||
}
|
||||
|
||||
void enableDefine(String define) {
|
||||
|
||||
@@ -5,27 +5,19 @@ plugins {
|
||||
}
|
||||
|
||||
def packageName = 'imgui-java-natives-linux'
|
||||
def packageDesc = 'Native binaries for imgui-java binding for 64bit Linux'
|
||||
def packageDesc = 'Native binaries for imgui-java binding for Linux'
|
||||
def fromDir = '../bin'
|
||||
def libName = 'libimgui-java64.so'
|
||||
|
||||
if (System.getProperty('deployWin32')) {
|
||||
packageName = 'imgui-java-natives-windows-x86'
|
||||
packageDesc = 'Native binaries for imgui-java binding for 32bit Windows'
|
||||
libName = 'imgui-java.dll'
|
||||
} else if (System.getProperty('deployWin64')) {
|
||||
if (System.getProperty('deployWin')) {
|
||||
packageName = 'imgui-java-natives-windows'
|
||||
packageDesc = 'Native binaries for imgui-java binding for 64bit Windows'
|
||||
packageDesc = 'Native binaries for imgui-java binding for Windows'
|
||||
libName = 'imgui-java64.dll'
|
||||
} else if (System.getProperty('deployLinux32')) {
|
||||
packageName = 'imgui-java-natives-linux-x86'
|
||||
packageDesc = 'Native binaries for imgui-java binding for 32bit Linux'
|
||||
libName = 'libimgui-java.so'
|
||||
} else if (System.getProperty('deployLinux64')) {
|
||||
} else if (System.getProperty('deployLinux')) {
|
||||
packageName = 'imgui-java-natives-linux'
|
||||
packageDesc = 'Native binaries for imgui-java binding for 64bit Linux'
|
||||
packageDesc = 'Native binaries for imgui-java binding for Linux'
|
||||
libName = 'libimgui-java64.so'
|
||||
} else if (System.getProperty('deployMacOs64')) {
|
||||
} else if (System.getProperty('deployMac')) {
|
||||
packageName = 'imgui-java-natives-macos'
|
||||
packageDesc = 'Native binaries for imgui-java binding for MacOS'
|
||||
libName = 'libimgui-java64.dylib'
|
||||
|
||||
@@ -107,6 +107,7 @@ public class ImGui {
|
||||
|
||||
final Path libBin = tmpDir.resolve(fullLibName);
|
||||
Files.copy(is, libBin, StandardCopyOption.REPLACE_EXISTING);
|
||||
libBin.toFile().deleteOnExit();
|
||||
|
||||
return libBin.toFile().getAbsolutePath();
|
||||
} catch (IOException e) {
|
||||
|
||||
Reference in new issue
Block a user