Add new simulate to CI.

PiperOrigin-RevId: 468670988
Change-Id: I2c6c7ac4763402f2a3e8df734746477e54a8ed8e
This commit is contained in:
Kevin Zakka
2022-08-19 04:16:33 -07:00
committed by Copybara-Service
parent 833dc74074
commit d466e390fc
2 changed files with 38 additions and 0 deletions
+12
View File
@@ -154,6 +154,18 @@ jobs:
- name: Build samples
working-directory: sample/build
run: cmake --build . --config=Release ${{ matrix.cmake_build_args }}
- name: Configure simulate
working-directory: simulate
run: >
mkdir build &&
cd build &&
cmake ..
-DCMAKE_BUILD_TYPE:STRING=Release
-Dmujoco_ROOT:STRING=${{ matrix.tmpdir }}/mujoco_install
${{ matrix.cmake_args }}
- name: Build simulate
working-directory: simulate/build
run: cmake --build . --config=Release ${{ matrix.cmake_build_args }}
- name: Make Python sdist
shell: bash
working-directory: python
+26
View File
@@ -22,6 +22,11 @@ set(CMAKE_POLICY_DEFAULT_CMP0072 NEW)
# This line has to appear before 'PROJECT' in order to be able to disable incremental linking
set(MSVC_INCREMENTAL_DEFAULT ON)
set(MUJOCO_DEP_VERSION_lodepng
b4ed2cd7ecf61d29076169b49199371456d4f90b
CACHE STRING "Version of `lodepng` to be fetched."
)
project(
mujoco_simulate
VERSION 2.2.1
@@ -71,6 +76,27 @@ if(MUJOCO_HARDEN)
endif()
endif()
# Fetch lodepng dependency.
if(NOT TARGET lodepng)
FetchContent_Declare(
lodepng
GIT_REPOSITORY https://github.com/lvandeve/lodepng.git
GIT_TAG ${MUJOCO_DEP_VERSION_lodepng}
)
FetchContent_GetProperties(lodepng)
if(NOT lodepng_POPULATED)
FetchContent_Populate(lodepng)
# This is not a CMake project.
set(LODEPNG_SRCS ${lodepng_SOURCE_DIR}/lodepng.cpp)
set(LODEPNG_HEADERS ${lodepng_SOURCE_DIR}/lodepng.h)
add_library(lodepng STATIC ${LODEPNG_HEADERS} ${LODEPNG_SRCS})
target_compile_options(lodepng PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS})
target_link_options(lodepng PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS})
target_include_directories(lodepng PUBLIC ${lodepng_SOURCE_DIR})
endif()
endif()
# mjsimulate library
add_library(mjsimulate STATIC)
target_sources(