Skip to content

Commit

Permalink
Merge pull request #4 from Angular-Angel/main
Browse files Browse the repository at this point in the history
added Linux support to build file
  • Loading branch information
tom-mohr authored Jan 29, 2023
2 parents 1cc6803 + d7941f7 commit dc362d7
Showing 1 changed file with 31 additions and 74 deletions.
105 changes: 31 additions & 74 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.gradle.internal.os.OperatingSystem

plugins {
id "java"
id "application" // for "run" task
Expand Down Expand Up @@ -59,8 +61,29 @@ jar {
mainClassName = "com.particle_life.app.Main" // required for "run" task
}

project.ext.lwjglVersion = "3.3.0"

switch (OperatingSystem.current()) {
case OperatingSystem.LINUX:
def osArch = System.getProperty("os.arch")
project.ext.natives = osArch.startsWith("arm") || osArch.startsWith("aarch64")
? "linux-${osArch.contains("64") || osArch.startsWith("armv8") ? "arm64" : "arm32"}"
: "linux"
break
case OperatingSystem.MAC_OS:
project.ext.natives = "macos"
break
case OperatingSystem.WINDOWS:
def osArch = System.getProperty("os.arch")
project.ext.natives = osArch.contains("64")
? "windows${osArch.startsWith("aarch64") ? "-arm64" : ""}"
: "windows-x86"
break
}

repositories {
mavenCentral()
mavenLocal()
maven { url "https://jitpack.io" }
}

Expand All @@ -73,80 +96,14 @@ dependencies {

// imGui
implementation "io.github.spair:imgui-java-binding:$imguiVersion"
implementation "io.github.spair:imgui-java-natives-windows:$imguiVersion"
implementation "io.github.spair:imgui-java-natives-$natives:$imguiVersion"

// LWJGL

implementation platform("org.lwjgl:lwjgl-bom:$lwjglVersion")

implementation "org.lwjgl:lwjgl"
implementation "org.lwjgl:lwjgl-assimp"
implementation "org.lwjgl:lwjgl-bgfx"
implementation "org.lwjgl:lwjgl-cuda"
implementation "org.lwjgl:lwjgl-egl"
implementation "org.lwjgl:lwjgl-glfw"
implementation "org.lwjgl:lwjgl-jawt"
implementation "org.lwjgl:lwjgl-jemalloc"
implementation "org.lwjgl:lwjgl-libdivide"
implementation "org.lwjgl:lwjgl-llvm"
implementation "org.lwjgl:lwjgl-lmdb"
implementation "org.lwjgl:lwjgl-lz4"
implementation "org.lwjgl:lwjgl-meow"
implementation "org.lwjgl:lwjgl-nanovg"
implementation "org.lwjgl:lwjgl-nfd"
implementation "org.lwjgl:lwjgl-nuklear"
implementation "org.lwjgl:lwjgl-odbc"
implementation "org.lwjgl:lwjgl-openal"
implementation "org.lwjgl:lwjgl-opencl"
implementation "org.lwjgl:lwjgl-opengl"
implementation "org.lwjgl:lwjgl-opengles"
implementation "org.lwjgl:lwjgl-openvr"
implementation "org.lwjgl:lwjgl-opus"
implementation "org.lwjgl:lwjgl-ovr"
implementation "org.lwjgl:lwjgl-par"
implementation "org.lwjgl:lwjgl-remotery"
implementation "org.lwjgl:lwjgl-rpmalloc"
implementation "org.lwjgl:lwjgl-shaderc"
implementation "org.lwjgl:lwjgl-sse"
implementation "org.lwjgl:lwjgl-stb"
implementation "org.lwjgl:lwjgl-tinyexr"
implementation "org.lwjgl:lwjgl-tinyfd"
implementation "org.lwjgl:lwjgl-tootle"
implementation "org.lwjgl:lwjgl-vma"
implementation "org.lwjgl:lwjgl-vulkan"
implementation "org.lwjgl:lwjgl-xxhash"
implementation "org.lwjgl:lwjgl-yoga"
implementation "org.lwjgl:lwjgl-zstd"
runtimeOnly "org.lwjgl:lwjgl::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-assimp::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-bgfx::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-glfw::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-jemalloc::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-libdivide::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-llvm::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-lmdb::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-lz4::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-meow::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-nanovg::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-nfd::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-nuklear::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-openal::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-opengl::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-opengles::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-openvr::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-opus::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-ovr::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-par::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-remotery::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-rpmalloc::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-shaderc::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-sse::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-stb::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-tinyexr::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-tinyfd::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-tootle::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-vma::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-xxhash::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-yoga::natives-windows"
runtimeOnly "org.lwjgl:lwjgl-zstd::natives-windows"

[".lwjgl", ".assimp", ".bgfx", ".cuda", ".egl", ".glfw", ".jawt", ".jemalloc", ".libdivide", ".llvm",
".lmdb", ".lz4", ".meow", ".nanovg", ".nfd", ".nuklear", ".odbc", ".openal", ".opencl", ".opengl", ".opengles",
".opus", ".ovr", ".par", ".remotery", ".rpmalloc", ".shaderc", ".sse", ".stb", ".tinyexr", ".tinyfd",
".tootle", ".vma", ".vulkan", ".xxhash", ".yoga", ".zstd"].each {
implementation "org.lwjgl.osgi:org.lwjgl$it:$lwjglVersion"
}
}

0 comments on commit dc362d7

Please sign in to comment.