Fix single-precision (mjUSESINGLE) CMake builds.

PiperOrigin-RevId: 947367737
Change-Id: If2b56c9d4b4c214c858f6d8b588443f6bd4896ee
This commit is contained in:
Yuval Tassa
2026-07-13 19:01:38 -07:00
committed by Copybara-Service
parent 9b053d68e9
commit 6afe13573b
+6 -1
View File
@@ -200,7 +200,12 @@ if(CMAKE_POLICY_VERSION_MINIMUM_LOCALLY_DEFINED)
unset(CMAKE_POLICY_VERSION_MINIMUM_LOCALLY_DEFINED)
endif()
set(ENABLE_DOUBLE_PRECISION ON)
# build ccd in single precision when MuJoCo is built with mjUSESINGLE
if(CMAKE_C_FLAGS MATCHES "mjUSESINGLE")
set(ENABLE_DOUBLE_PRECISION OFF)
else()
set(ENABLE_DOUBLE_PRECISION ON)
endif()
set(CCD_HIDE_ALL_SYMBOLS ON)
# Patch changes in https://github.com/danfis/libccd/pull/83.patch