%bcond tests 1 Name: joltphysics Version: 5.6.0 Release: %autorelease Summary: Multithreaded rigid body physics and collision detection library License: MIT URL: https://github.com/jrouwe/JoltPhysics Source0: %{url}/archive/refs/tags/v%{version}.tar.gz#/JoltPhysics-%{version}.tar.gz # Upstream has no s390x backend. ExclusiveArch: x86_64 aarch64 ppc64le riscv64 BuildRequires: cmake >= 3.20 BuildRequires: gcc-c++ BuildRequires: ninja-build %if %{with tests} BuildRequires: doctest-devel %endif %description Jolt Physics is a multithreaded rigid body physics and collision detection library for games and virtual reality applications. It supports rigid and soft bodies, constraints, vehicles, character controllers and collision queries. This package enables CPU compute support; GPU compute backends are disabled. %package devel Summary: Development files for Jolt Physics Requires: %{name}%{?_isa} = %{version}-%{release} %description devel Headers and CMake configuration files for developing applications with Jolt Physics. Use find_package(Jolt CONFIG REQUIRED) and link to Jolt::Jolt to inherit the library's required compile definitions. %prep %autosetup -n JoltPhysics-%{version} # Upstream does not version its shared library. # Use a release-specific SONAME; rebuild consumers on each version update. sed -i '/^add_library(Jolt::Jolt ALIAS Jolt)$/a set_target_properties(Jolt PROPERTIES VERSION %{version} SOVERSION %{version})' \ Jolt/Jolt.cmake %if %{with tests} # Use Fedora's doctest instead of the bundled copy. rm UnitTests/doctest.h ln -s %{_includedir}/doctest/doctest.h UnitTests/doctest.h %endif %build %cmake -S Build \ -DJPH_BUILD_SHARED_LIBS=ON \ -DENABLE_INSTALL=ON \ -DOVERRIDE_CXX_FLAGS=OFF \ -DGENERATE_DEBUG_SYMBOLS=OFF \ -DINTERPROCEDURAL_OPTIMIZATION=OFF \ -DENABLE_ALL_WARNINGS=OFF \ -DUSE_ASSERTS=ON \ -DCPP_EXCEPTIONS_ENABLED=ON \ -DCPP_RTTI_ENABLED=ON \ -DDOUBLE_PRECISION=OFF \ -DDEBUG_RENDERER_IN_DEBUG_AND_RELEASE=OFF \ -DPROFILER_IN_DEBUG_AND_RELEASE=OFF \ -DJPH_USE_DX12=OFF \ -DJPH_USE_VK=OFF \ -DJPH_USE_MTL=OFF \ -DJPH_USE_CPU_COMPUTE=ON \ -DUSE_SSE4_1=OFF \ -DUSE_SSE4_2=OFF \ -DUSE_AVX=OFF \ -DUSE_AVX2=OFF \ -DUSE_AVX512=OFF \ -DUSE_LZCNT=OFF \ -DUSE_TZCNT=OFF \ -DUSE_F16C=OFF \ -DUSE_FMADD=OFF \ -DTARGET_UNIT_TESTS=%{with tests} \ -DTARGET_HELLO_WORLD=OFF \ -DTARGET_PERFORMANCE_TEST=OFF \ -DTARGET_SAMPLES=OFF \ -DTARGET_VIEWER=OFF %cmake_build %install %cmake_install %check %if %{with tests} %ctest %endif %files %license LICENSE %doc README.md %{_libdir}/libJolt.so.%{version} %files devel %{_includedir}/Jolt/ %{_libdir}/libJolt.so %{_libdir}/cmake/Jolt/ %changelog %autochangelog