forked from zalo/mujoco_wasm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
109 changed files
with
1,240 additions
and
496,419 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
cmake_minimum_required(VERSION 3.2) | ||
cmake_minimum_required(VERSION 3.15) | ||
option(JS_ONLY "Compiles to native JS (No WASM)" OFF) | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/dist") | ||
|
||
project(mujoco_wasm) | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O3") | ||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O3") | ||
|
||
set(CMAKE_INSTALL_PREFIX ${PROJECT_SOURCE_DIR}) | ||
|
||
set(MUJOCO_INSTALL_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include) | ||
set(MUJOCO_INSTALL_BIN_DIR ${PROJECT_SOURCE_DIR}/bin) | ||
set(MUJOCO_INSTALL_LIB_DIR ${PROJECT_SOURCE_DIR}/lib) | ||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") | ||
|
||
include_directories(${MUJOCO_INSTALL_INCLUDE_DIR}) | ||
link_directories(${MUJOCO_INSTALL_LIB_DIR}) | ||
include(dependencies) | ||
|
||
|
||
include_directories("${FETCHCONTENT_BASE_DIR}/mujoco-src/include") | ||
|
||
add_subdirectory(src) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
rem This script requires that the Emscripten SDK has been set up in the directory above this one. | ||
rem Follow the instructions here: https://emscripten.org/docs/getting_started/downloads.html | ||
|
||
call python src/parse_mjxmacro.py | ||
rmdir /s /q build | ||
call ../emsdk/emsdk activate latest | ||
mkdir build | ||
cd build | ||
call emcmake cmake .. | ||
cd .. | ||
call python src/parse_mjxmacro.py build/_deps/mujoco-src | ||
cd build | ||
call emmake make | ||
cd ../dist | ||
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
include(FetchContent) | ||
|
||
|
||
################################################# | ||
# libccd | ||
|
||
set(ENABLE_DOUBLE_PRECISION ON) | ||
set(CCD_HIDE_ALL_SYMBOLS ON) | ||
|
||
set(LIBCCD_CMAKE_PATCH git apply ${CMAKE_CURRENT_SOURCE_DIR}/cmake/patches/libccd.patch) | ||
|
||
# Fetch the repositories | ||
FetchContent_Declare( | ||
ccd | ||
GIT_REPOSITORY https://github.com/danfis/libccd.git | ||
GIT_TAG "7931e764a19ef6b21b443376c699bbc9c6d4fba8" # aka "v2.1" | ||
PATCH_COMMAND ${LIBCCD_CMAKE_PATCH} | ||
UPDATE_DISCONNECTED 1 | ||
) | ||
|
||
FetchContent_MakeAvailable(ccd) | ||
|
||
|
||
################################################# | ||
# Mujoco | ||
|
||
set(MUJOCO_CMAKE_PATCH git apply ${CMAKE_CURRENT_SOURCE_DIR}/cmake/patches/mujoco.patch) | ||
|
||
# Fetch the repositories | ||
FetchContent_Declare( | ||
mujoco | ||
GIT_REPOSITORY https://github.com/google-deepmind/mujoco.git | ||
GIT_TAG "0f64959e279e63b62a7610c23e0396c000f28c06" # aka "3.2.6" | ||
PATCH_COMMAND ${MUJOCO_CMAKE_PATCH} | ||
UPDATE_DISCONNECTED 1 | ||
) | ||
|
||
FetchContent_MakeAvailable(mujoco) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 35bf430..1a35bb8 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -1,4 +1,4 @@ | ||
-cmake_minimum_required(VERSION 2.8.11) | ||
+cmake_minimum_required(VERSION 3.15) | ||
|
||
if(POLICY CMP0042) | ||
cmake_policy(SET CMP0042 NEW) | ||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt | ||
index 1407080..3ecb3f9 100644 | ||
--- a/src/CMakeLists.txt | ||
+++ b/src/CMakeLists.txt | ||
@@ -39,7 +39,7 @@ set(CCD_SOURCES | ||
support.h | ||
vec3.c) | ||
|
||
-add_library(ccd ${CCD_INCLUDES} ${CCD_SOURCES}) | ||
+add_library(ccd STATIC ${CCD_INCLUDES} ${CCD_SOURCES}) | ||
set_target_properties(ccd PROPERTIES | ||
PUBLIC_HEADER "${CCD_INCLUDES}" | ||
SOVERSION ${CCD_SOVERSION} | ||
@@ -48,7 +48,7 @@ target_include_directories(ccd PUBLIC | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>) | ||
|
||
-if(NOT WIN32) | ||
+if(NOT WIN32 AND NOT (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")) | ||
find_library(LIBM_LIBRARY NAMES m) | ||
if(NOT LIBM_LIBRARY) | ||
message(FATAL_ERROR "Could NOT find required library LibM") | ||
@@ -83,6 +83,6 @@ if(UNIX) | ||
endif() | ||
endif() | ||
|
||
-if(NOT WIN32 AND BUILD_TESTING AND NOT CCD_HIDE_ALL_SYMBOLS) | ||
- add_subdirectory(testsuites) | ||
-endif() | ||
+# if(NOT WIN32 AND BUILD_TESTING AND NOT CCD_HIDE_ALL_SYMBOLS) | ||
+# add_subdirectory(testsuites) | ||
+# endif() |
Oops, something went wrong.