Skip to content

Commit

Permalink
add support for system Bullet
Browse files Browse the repository at this point in the history
  • Loading branch information
ognevny committed Apr 8, 2024
1 parent 31bdb52 commit 658fb43
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ option(USE_SYSTEM_ENET "Use system ENet instead of the built-in version, when av
CMAKE_DEPENDENT_OPTION(USE_IPV6 "Allow create or connect to game server with IPv6 address, system enet will not be used." ON
"NOT USE_SWITCH" OFF)
option(USE_SYSTEM_WIIUSE "Use system WiiUse instead of the built-in version, when available." OFF)
option(USE_SYSTEM_BULLET "Use system Bullet instead if the built-in version, when available." OFF)
option(USE_SQLITE3 "Use sqlite to manage server stats and ban list." ON)

if(APPLE)
Expand Down Expand Up @@ -88,7 +89,7 @@ if (IOS)
endif()

if((UNIX AND NOT APPLE) AND NOT SERVER_ONLY)
if((${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm") OR
if((${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm") OR
(${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64") OR
(${CMAKE_SYSTEM_PROCESSOR} MATCHES "riscv64"))
option(USE_GLES2 "Use OpenGL ES2 renderer" ON)
Expand Down Expand Up @@ -207,9 +208,18 @@ if(UNIX AND NOT APPLE AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
endif()
endif()

# Build the Bullet physics library
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/bullet")
include_directories(BEFORE "${PROJECT_SOURCE_DIR}/lib/bullet/src")
if(USE_SYSTEM_BULLET)
find_package(Bullet)
if(BULLET_FOUND)
include_directories(${BULLET_INCLUDE_DIRS})
else()
message(FATAL_ERROR "Bullet not found. ")
endif()
else()
# Build the Bullet physics library
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/bullet")
include_directories(BEFORE "${PROJECT_SOURCE_DIR}/lib/bullet/src")
endif()

# Build the DNS C library
if(USE_DNS_C)
Expand Down

0 comments on commit 658fb43

Please sign in to comment.