Statically link freetype

This commit is contained in:
MrLetsplay 2023-09-09 16:35:31 +02:00
parent 6f1b907c04
commit baffb7c21c
Signed by: mr
SSH Key Fingerprint: SHA256:92jBH80vpXyaZHjaIl47pjRq+Yt7XGTArqQg1V7hSqg
5 changed files with 20 additions and 23 deletions

3
.gitmodules vendored
View File

@ -7,3 +7,6 @@
[submodule "dependencies/bullet3"]
path = dependencies/bullet3
url = https://github.com/bulletphysics/bullet3.git
[submodule "dependencies/freetype"]
path = dependencies/freetype
url = https://github.com/freetype/freetype.git

View File

@ -42,20 +42,12 @@ else()
add_compile_options(-Wall -O3)
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)
block()
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/microtar)
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)
add_subdirectory(dependencies/freetype)
endblock()
# kekengine resources
add_custom_target(kekengine_res ALL DEPENDS ${KEKENGINE_RESOURCE_FILES})
@ -72,16 +64,18 @@ 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_include_directories(kekengine PUBLIC "src/kekengine/include")
target_include_directories(kekengine PUBLIC "dependencies/bullet3/src")
target_include_directories(kekengine PUBLIC "dependencies/freetype/include")
target_link_libraries(kekengine PUBLIC microtar_static)
# Freetype
find_package(PkgConfig REQUIRED)
pkg_check_modules(FREETYPE REQUIRED freetype2)
target_link_libraries(kekengine PUBLIC ${FREETYPE_LIBRARIES})
target_include_directories(kekengine PUBLIC ${FREETYPE_INCLUDE_DIRS})
# find_package(PkgConfig REQUIRED)
#
# 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})
@ -106,8 +100,6 @@ if(${KEKENGINE_VR})
target_link_libraries(kekengine PUBLIC openvr_api)
endif()
target_include_directories(kekengine PRIVATE "src/kekengine/include")
if(UNIX)
target_compile_definitions(kekengine PUBLIC KEKENGINE_TARGET_LINUX)
endif()
@ -123,11 +115,13 @@ 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)
target_link_libraries(kekengine_shared PUBLIC freetype)
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)
target_link_libraries(kekengine_static PUBLIC freetype)
set_target_properties(kekengine_static PROPERTIES OUTPUT_NAME kekengine)
if(${KEKENGINE_BUILD_KEKGAME})
@ -151,6 +145,4 @@ if(${KEKENGINE_BUILD_KEKGAME})
endif()
target_link_libraries(kekgame PUBLIC kekengine_static)
target_include_directories(kekgame PRIVATE "src/kekengine/include")
target_include_directories(kekgame PRIVATE "dependencies/bullet3/src")
endif()

View File

@ -4,3 +4,4 @@
- microtar (included)
- openvr (SteamVR), if compiling with KEKENGINE_VR
- bullet 3
- freetype

1
dependencies/freetype vendored Submodule

@ -0,0 +1 @@
Subproject commit 68f1b93247b62dbee7979f4c1429fe4c645fb5c1

2
dependencies/openvr vendored

@ -1 +1 @@
Subproject commit 08de3821dfd3aa46f778376680c68f33b9fdcb6c
Subproject commit 5e45960cf44d6eb19bbadcae4a3d32578a380c17