Initial open sourcing of MuJoCo.
PiperOrigin-RevId: 450374687 Change-Id: Ie3225a46ce095fc28ae8e63c326a640261f562bb
This commit is contained in:
committed by
Copybara-Service
parent
0e5d062302
commit
1913a02b40
@@ -23,11 +23,6 @@ set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
# INTERPROCEDURAL_OPTIMIZATION is enforced when enabled.
|
||||
set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
|
||||
|
||||
if(APPLE)
|
||||
add_compile_options(-Werror=partial-availability -Werror=unguarded-availability)
|
||||
add_link_options(-Wl,-no_weak_imports)
|
||||
endif()
|
||||
|
||||
add_library(crossplatform INTERFACE)
|
||||
target_sources(crossplatform INTERFACE crossplatform.h)
|
||||
set_target_properties(crossplatform PROPERTIES PUBLIC_HEADER crossplatform.h)
|
||||
@@ -62,7 +57,8 @@ target_link_libraries(
|
||||
func_traits
|
||||
)
|
||||
|
||||
if(MUJOCO_TEST_PYTHON_UTIL)
|
||||
if(BUILD_TESTING)
|
||||
enable_testing()
|
||||
add_executable(array_traits_test array_traits_test.cc)
|
||||
target_link_libraries(
|
||||
array_traits_test
|
||||
|
||||
@@ -48,4 +48,29 @@
|
||||
#define MUJOCO_ALWAYS_INLINE_LAMBDA_MUTABLE
|
||||
#endif
|
||||
|
||||
#ifndef MUJOCO_DIAG_IGNORE_UNUSED_LAMBDA_CAPTURE
|
||||
#if defined(__clang__)
|
||||
#define MUJOCO_DIAG_IGNORE_UNUSED_LAMBDA_CAPTURE \
|
||||
_Pragma("clang diagnostic push") \
|
||||
_Pragma("clang diagnostic ignored \"-Wunused-lambda-capture\"")
|
||||
#define MUJOCO_DIAG_UNIGNORE_UNUSED_LAMBDA_CAPTURE \
|
||||
_Pragma("clang diagnostic pop")
|
||||
#elif defined(__GNUC__)
|
||||
#define MUJOCO_DIAG_IGNORE_UNUSED_LAMBDA_CAPTURE \
|
||||
_Pragma("GCC diagnostic push") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wunused-lambda-capture\"")
|
||||
#define MUJOCO_DIAG_UNIGNORE_UNUSED_LAMBDA_CAPTURE _Pragma("GCC diagnostic pop")
|
||||
#else
|
||||
#define MUJOCO_DIAG_IGNORE_UNUSED_LAMBDA_CAPTURE
|
||||
#define MUJOCO_DIAG_UNIGNORE_UNUSED_LAMBDA_CAPTURE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// GCC ignores [[maybe_unused]] and emits a -Wattributes
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#define MUJOCO_MAYBE_UNUSED
|
||||
#else
|
||||
#define MUJOCO_MAYBE_UNUSED [[maybe_unused]]
|
||||
#endif
|
||||
|
||||
#endif // MUJOCO_PYTHON_UTIL_CROSSPLATFORM_H_
|
||||
|
||||
Reference in New Issue
Block a user