Enable building Studio (Linux only) as a component of the main MuJoCo build.
And remove the separate, conditional (and hacky) "build_studio" step. PiperOrigin-RevId: 934375150 Change-Id: I46514d0f33c17bb29625b818cdde3a285fd2c439
This commit is contained in:
committed by
Copybara-Service
parent
1f8c6f1183
commit
8db92ab4a9
+26
-2
@@ -218,11 +218,35 @@ class BuildCMakeExtension(build_ext.build_ext):
|
||||
)
|
||||
os.makedirs(dst)
|
||||
for directory, _, filenames in os.walk(self._mujoco_include_path):
|
||||
rel_dir = os.path.relpath(directory, self._mujoco_include_path)
|
||||
|
||||
# Skip third-party directories
|
||||
if rel_dir.startswith(('SDL2', 'math', 'misc')):
|
||||
continue
|
||||
|
||||
for filename in fnmatch.filter(filenames, '*.h'):
|
||||
shutil.copyfile(
|
||||
os.path.join(directory, filename), os.path.join(dst, filename)
|
||||
rel_file_path = os.path.relpath(
|
||||
os.path.join(directory, filename), self._mujoco_include_path
|
||||
)
|
||||
|
||||
# Skip third-party files in the root include path (for framework case)
|
||||
if rel_dir == '.' and not (
|
||||
filename == 'mujoco.h' or filename.startswith('mj')
|
||||
):
|
||||
continue
|
||||
|
||||
# Reconstruct destination path preserving structure
|
||||
# Strip leading 'mujoco/' if present to avoid duplicate 'mujoco/mujoco/'
|
||||
if rel_file_path.startswith('mujoco/'):
|
||||
target_rel_path = rel_file_path[len('mujoco/') :]
|
||||
else:
|
||||
target_rel_path = rel_file_path
|
||||
|
||||
target_dst = os.path.join(dst, target_rel_path)
|
||||
os.makedirs(os.path.dirname(target_dst), exist_ok=True)
|
||||
shutil.copyfile(os.path.join(directory, filename), target_dst)
|
||||
|
||||
|
||||
def _copy_studio_assets(self):
|
||||
assets_src = None
|
||||
for directory, subdirs, _ in os.walk(os.environ[MUJOCO_PATH]):
|
||||
|
||||
Reference in New Issue
Block a user