diff --git a/src/user/CMakeLists.txt b/src/user/CMakeLists.txt index 0727c5a9..a6914c9e 100644 --- a/src/user/CMakeLists.txt +++ b/src/user/CMakeLists.txt @@ -25,3 +25,4 @@ set(MUJOCO_USER_SRCS ) target_sources(mujoco PRIVATE ${MUJOCO_USER_SRCS}) +target_compile_definitions(mujoco PRIVATE MUJOCO_TINYOBJLOADER_IMPL) diff --git a/src/user/user_mesh.cc b/src/user/user_mesh.cc index ed382f5c..0912bb12 100644 --- a/src/user/user_mesh.cc +++ b/src/user/user_mesh.cc @@ -22,7 +22,9 @@ #include #include +#ifdef MUJOCO_TINYOBJLOADER_IMPL #define TINYOBJLOADER_IMPLEMENTATION +#endif #include #include "cc/array_safety.h"