Include obj and stl decoder plugins as sources in CMake builds.

This removes the need to load these decoders via mj_loadAllPluginLibraries when using MuJoCo built with CMake. Other plugins are unchanged.

PiperOrigin-RevId: 897114719
Change-Id: Iee914cc5e05798186f384a67901f1cf86bc2f887
This commit is contained in:
Sam Haves
2026-04-09 07:57:37 -07:00
committed by Copybara-Service
parent 81720071b8
commit a744b366fb
11 changed files with 21 additions and 107 deletions
+6 -1
View File
@@ -53,6 +53,11 @@ add_executable(mujoco_wasm_benchmark ${MUJOCO_WASM_FILES})
set_target_properties(mujoco_wasm_benchmark PROPERTIES LINK_FLAGS "${EMCC_LINKER_FLAGS_STR}")
target_link_libraries(mujoco_wasm_benchmark ccd lodepng mujoco tinyxml2 qhullstatic_r obj_decoder stl_decoder)
# Link the mujoco library as a whole archive to avoid losing plugin
# registration such as obj_decoder and stl_decoder.
target_link_libraries(mujoco_wasm_benchmark PRIVATE
-Wl,--whole-archive mujoco -Wl,--no-whole-archive
ccd lodepng tinyxml2 qhullstatic_r
)
install(TARGETS mujoco_wasm_benchmark DESTINATION ${DIVISIBLE_INSTALL_BIN_DIR})