chipmunk2d: Fix Android static lib (#3658)

* chipmunk2d: Fix Android static lib

* Fix chipmunk2d on Android in shared mode

* Update xmake.lua
pull/3131/head
Jérôme Leclercq 8 months ago committed by GitHub
parent d6c1d721d6
commit 1468df7234
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 14
      packages/c/chipmunk2d/patches/7.0.3/android.patch
  2. 4
      packages/c/chipmunk2d/xmake.lua

@ -15,6 +15,20 @@ index 9544da8..82d027e 100644
#endif
/// @defgroup basicTypes Basic Types
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 34882d1..56589fb 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -31,6 +31,9 @@ if(BUILD_SHARED)
# need to explicitly link to the math library because the CMake/Android toolchains may not do it automatically
target_link_libraries(chipmunk m)
endif(ANDROID OR UNIX)
+ if(ANDROID)
+ target_link_libraries(chipmunk log)
+ endif(ANDROID)
install(TARGETS chipmunk RUNTIME DESTINATION ${BIN_INSTALL_DIR}
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
diff --git a/src/cpHastySpace.c b/src/cpHastySpace.c
index 8dca425..fa3074d 100644
--- a/src/cpHastySpace.c

@ -1,5 +1,4 @@
package("chipmunk2d")
set_homepage("https://chipmunk-physics.net/")
set_description("A fast and lightweight 2D game physics library.")
set_license("MIT")
@ -23,6 +22,8 @@ package("chipmunk2d")
if is_plat("linux") then
add_syslinks("pthread", "m")
elseif is_plat("android") then
add_syslinks("log", "m")
end
on_install("windows", "linux", "macosx", "iphoneos", "mingw", "android", "wasm", function (package)
@ -35,6 +36,7 @@ package("chipmunk2d")
else
table.insert(configs, "-DBUILD_SHARED=OFF")
table.insert(configs, "-DBUILD_STATIC=ON")
table.insert(configs, "-DINSTALL_STATIC=ON")
end
import("package.tools.cmake").install(package, configs)
os.vcp("include/chipmunk", package:installdir("include"))

Loading…
Cancel
Save