Statically link bullet3

This commit is contained in:
MrLetsplay 2023-09-09 16:18:36 +02:00
parent 1dacf19af3
commit 6f1b907c04
Signed by: mr
SSH Key Fingerprint: SHA256:92jBH80vpXyaZHjaIl47pjRq+Yt7XGTArqQg1V7hSqg
4 changed files with 28 additions and 6 deletions

5
.gitmodules vendored
View File

@ -3,4 +3,7 @@
url = https://github.com/MrLetsplay2003/microtar.git
[submodule "dependencies/openvr"]
path = dependencies/openvr
url = https://github.com/ValveSoftware/openvr
url = https://github.com/ValveSoftware/openvr.git
[submodule "dependencies/bullet3"]
path = dependencies/bullet3
url = https://github.com/bulletphysics/bullet3.git

View File

@ -44,6 +44,19 @@ endif()
add_subdirectory(dependencies/microtar)
# set(BUILD_SHARED_LIBS OFF)
# set(BUILD_CPU_DEMOS OFF)
# set(BUILD_BULLET2_DEMOS OFF)
# set(BUILD_OPENGL3_DEMOS OFF)
# set(BUILD_UNIT_TESTS OFF)
# set(BUILD_EXTRAS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# set(POSITION_INDEPENDENT_CODE ON CACHE BOOL "Enable stuff")
# set(BUILD_SHARED_LIBS ON CACHE BOOL "Enable stuff")
add_subdirectory(dependencies/bullet3 EXCLUDE_FROM_ALL)
# set_property(DIRECTORY dependencies/bullet3 PROPERTY POSITION_INDEPENDENT_CODE 1)
# set_property(DIRECTORY dependencies/bullet3 PROPERTY BUILD_SHARED_LIBS 1)
# kekengine resources
add_custom_target(kekengine_res ALL DEPENDS ${KEKENGINE_RESOURCE_FILES})
@ -59,6 +72,8 @@ add_library(kekengine OBJECT ${KEKENGINE_SOURCE_FILES})
set_property(TARGET kekengine PROPERTY POSITION_INDEPENDENT_CODE 1)
add_dependencies(kekengine kekengine_res)
target_include_directories(kekengine PRIVATE "dependencies/bullet3/src")
target_link_libraries(kekengine PUBLIC microtar_static)
# Freetype
@ -68,9 +83,9 @@ pkg_check_modules(FREETYPE REQUIRED freetype2)
target_link_libraries(kekengine PUBLIC ${FREETYPE_LIBRARIES})
target_include_directories(kekengine PUBLIC ${FREETYPE_INCLUDE_DIRS})
pkg_check_modules(BULLET REQUIRED bullet)
target_link_libraries(kekengine PUBLIC ${BULLET_LIBRARIES})
target_include_directories(kekengine PUBLIC ${BULLET_INCLUDE_DIRS})
#pkg_check_modules(BULLET REQUIRED bullet)
#target_link_libraries(kekengine PUBLIC ${BULLET_LIBRARIES})
#target_include_directories(kekengine PUBLIC ${BULLET_INCLUDE_DIRS})
if(UNIX)
target_link_libraries(kekengine PUBLIC glfw GLEW GL)
@ -107,9 +122,12 @@ endif()
add_library(kekengine_shared SHARED $<TARGET_OBJECTS:kekengine>)
target_link_libraries(kekengine_shared PUBLIC kekengine)
target_link_libraries(kekengine_shared PUBLIC Bullet3Collision BulletDynamics BulletCollision LinearMath Bullet3Collision Bullet3Common Bullet3Dynamics Bullet3Geometry BulletInverseDynamics)
set_target_properties(kekengine_shared PROPERTIES OUTPUT_NAME kekengine)
add_library(kekengine_static STATIC $<TARGET_OBJECTS:kekengine>)
target_link_libraries(kekengine_static PUBLIC kekengine)
target_link_libraries(kekengine_static PUBLIC BulletSoftBody BulletDynamics BulletCollision LinearMath Bullet3Collision Bullet3Common Bullet3Dynamics Bullet3Geometry BulletInverseDynamics)
set_target_properties(kekengine_static PROPERTIES OUTPUT_NAME kekengine)
if(${KEKENGINE_BUILD_KEKGAME})
@ -134,4 +152,5 @@ if(${KEKENGINE_BUILD_KEKGAME})
target_link_libraries(kekgame PUBLIC kekengine_static)
target_include_directories(kekgame PRIVATE "src/kekengine/include")
target_include_directories(kekgame PRIVATE "dependencies/bullet3/src")
endif()

1
dependencies/bullet3 vendored Submodule

@ -0,0 +1 @@
Subproject commit 39b8de74df93721add193e5b3d9ebee579faebf8

View File

@ -5,8 +5,7 @@
#include <GLFW/glfw3.h>
#include <BulletCollision/CollisionShapes/btBoxShape.h>
#include <BulletCollision/btBulletCollisionCommon.h>
#include <BulletCollision/btBulletCollisionCommon.h>
#include <btBulletCollisionCommon.h>
#include <btBulletDynamicsCommon.h>
#include "internal.h"