Skip to content

Commit

Permalink
#15 JNBullet does not have Mac aarch64 target
Browse files Browse the repository at this point in the history
  • Loading branch information
asotona authored and skaldarnar committed Mar 15, 2024
1 parent 2691be1 commit 4603718
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ TeraBullet is a version of bullet with extensions for direct interactions for vo
- linux_windows_amd64_mingw32.cmake
- linux_windows_i686_mingw32.cmake
- macosx_amd64_clang.cmake
- macosx_aarch64_clang.cmake
- windows_amd64_msvc.cmake
- windows_i386_msvc.cmake

Expand Down Expand Up @@ -77,6 +78,7 @@ To build the java portion of bullet, simply run `./gradlew build`
* mac
- i686
- amd64
- aarch64

### System prerequisites

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ plugins {
import org.apache.tools.ant.taskdefs.condition.Os
ext {
if(Os.isFamily(Os.FAMILY_MAC)) {
natives = ["macosx_amd64_clang"]
natives = ["macosx_amd64_clang","macosx_aarch64_clang"]
} else if (Os.isFamily(Os.FAMILY_UNIX)) {
natives = ["linux_amd64_gcc","linux_i686_gcc","linux_windows_amd64_mingw32","linux_windows_i686_mingw32"]
} else {
throw new GradleException("This script only works on Linux or Mac")
}

allNatives = ["linux_amd64_gcc","linux_i686_gcc","linux_windows_amd64_mingw32","linux_windows_i686_mingw32","macosx_amd64_clang"]
allNatives = ["linux_amd64_gcc","linux_i686_gcc","linux_windows_amd64_mingw32","linux_windows_i686_mingw32","macosx_amd64_clang","macosx_aarch64_clang"]

generatedSrcDir = 'src/generated/java'
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=1.0.3-SNAPSHOT
version=1.0.4-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public final class NativeSupport {
static boolean isWindows = System.getProperty("os.name").toLowerCase().contains("win");
static boolean isMacOS = System.getProperty("os.name").toLowerCase().contains("mac");
static boolean is64 = System.getProperty("os.arch").endsWith("64");
static boolean isArm = System.getProperty("os.arch").endsWith("aarch64");

private static final Pattern PATH_SEPARATOR = Pattern.compile(File.pathSeparator);

Expand Down Expand Up @@ -80,7 +81,9 @@ public static void load(String name) {
target += "linux-";
}

if (is64) {
if (isArm) {
target += "aarch64";
} else if (is64) {
// Assume x86_64
target += "amd64";
} else {
Expand Down
24 changes: 24 additions & 0 deletions toolchains/macosx_aarch64_clang.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2015, alex at staticlibs.net
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

cmake_minimum_required ( VERSION 2.8.12 )

# default to Debug
set ( CMAKE_BUILD_TYPE "Debug" CACHE STRING "Default build type" )

set ( CMAKE_SYSTEM_NAME Darwin )
set ( CMAKE_SYSTEM_ARCH aarch64)

set ( CMAKE_C_COMPILER clang )
set ( CMAKE_CXX_COMPILER clang++ )

0 comments on commit 4603718

Please sign in to comment.