Create list_dependencies sample to list all dependencies for an MCJF file.

PiperOrigin-RevId: 814816067
Change-Id: Idc6232e5d1ef1ff0318aeacd0e3d4b4a5a303485
This commit is contained in:
Sam Haves
2025-10-03 13:46:20 -07:00
committed by Copybara-Service
parent 6ae9cc8061
commit e4704cd28b
8 changed files with 97 additions and 29 deletions
+10
View File
@@ -76,12 +76,19 @@ target_compile_options(compile PUBLIC ${MUJOCO_SAMPLE_COMPILE_OPTIONS})
target_link_libraries(compile Threads::Threads)
target_link_options(compile PRIVATE ${MUJOCO_SAMPLE_LINK_OPTIONS})
# Build sample binaries
add_executable(dependencies dependencies.cc)
target_compile_options(dependencies PUBLIC ${MUJOCO_SAMPLE_COMPILE_OPTIONS})
target_link_libraries(dependencies Threads::Threads)
target_link_options(dependencies PRIVATE ${MUJOCO_SAMPLE_LINK_OPTIONS})
add_executable(testspeed testspeed.cc)
target_compile_options(testspeed PUBLIC ${MUJOCO_SAMPLE_COMPILE_OPTIONS})
target_link_libraries(testspeed Threads::Threads)
target_link_options(testspeed PRIVATE ${MUJOCO_SAMPLE_LINK_OPTIONS})
target_link_libraries(compile mujoco::mujoco)
target_link_libraries(dependencies mujoco::mujoco)
target_link_libraries(testspeed mujoco::mujoco)
# Build samples that require GLFW.
@@ -109,6 +116,7 @@ target_link_options(record PRIVATE ${MUJOCO_SAMPLE_LINK_OPTIONS})
if(APPLE AND MUJOCO_BUILD_MACOS_FRAMEWORKS)
embed_in_bundle(basic simulate)
embed_in_bundle(compile simulate)
embed_in_bundle(dependencies simulate)
embed_in_bundle(record simulate)
embed_in_bundle(testspeed simulate)
endif()
@@ -127,6 +135,7 @@ if(_INSTALL_SAMPLES)
TARGETS
basic
compile
dependencies
record
testspeed
INSTALL_DIRECTORY
@@ -140,6 +149,7 @@ if(_INSTALL_SAMPLES)
install(
TARGETS basic
compile
dependencies
record
testspeed
EXPORT ${PROJECT_NAME}