Skip to content

Commit

Permalink
Build Jolt as a static library;
Browse files Browse the repository at this point in the history
joltc's current CMakeLists forces itself to build as a shared library on
PC/Android.  However, it builds Jolt using the current value of
BUILD_SHARED_LIBS.

We currently have BUILD_SHARED_LIBS set to ON when adding joltc, so we
end up with 2 shared libraries, which is cumbersome.  We'd rather just
have a single library for Jolt.  So instead, let's set BUILD_SHARED_LIBS
to off when adding the project, which will build Jolt as a static
library and joltc as a shared library (linking to the static library).

That way we just end up with a single shared library that contains both
joltc and Jolt.
  • Loading branch information
bjornbytes committed May 7, 2024
1 parent 2cb11cf commit ef4ddd3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ if(LOVR_ENABLE_PHYSICS)
set(LOVR_PHYSICS_LIB ode)
endif()
elseif(LOVR_PHYSICS_LIBRARY STREQUAL "JOLT")
set(BUILD_SHARED_LIBS OFF)
set(DEBUG_RENDERER_IN_DEBUG_AND_RELEASE OFF CACHE BOOL "")
set(PROFILER_IN_DEBUG_AND_RELEASE OFF CACHE BOOL "")
add_subdirectory(deps/jolt-physics-sharp jolt)
Expand Down

0 comments on commit ef4ddd3

Please sign in to comment.