Skip to content

Commit ac6663f

Browse files
authored
Fix compilation when using Windows SDK <= 10.0.22000
1 parent c50c92c commit ac6663f

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,11 @@ jobs:
9494
-DMUJOCO_HARDEN:BOOL=ON
9595
tmpdir: "/tmp"
9696
- os: windows-2022
97-
cmake_args: >-
98-
-DCMAKE_SYSTEM_VERSION="10.0.22621.0"
97+
cmake_args: ""
9998
cmake_build_args: "-- -m"
10099
tmpdir: "C:/Temp"
101100
- os: windows-2019
102-
cmake_args: >-
103-
-DCMAKE_SYSTEM_VERSION="10.0.22621.0"
101+
cmake_args: ""
104102
cmake_build_args: "-- -m"
105103
tmpdir: "C:/Temp"
106104

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,13 @@ if(APPLE AND MUJOCO_BUILD_MACOS_FRAMEWORKS)
158158
)
159159
endif()
160160

161+
# This code is a workaround for https://github.com/deepmind/mujoco/issues/862
162+
# Once it can be assumed that no users uses a Windows SDK < 10.0.22000
163+
# we can drop this code
164+
if(MSVC AND CMAKE_SYSTEM_VERSION VERSION_LESS 10.0.22000)
165+
target_compile_definitions(mujoco PRIVATE MUJOCO_WINSDK_NO_STDALIGN_H)
166+
endif()
167+
161168
# Add a namespace alias to mujoco to be used by the examples.
162169
# This simulates the install interface when building with sources.
163170
add_library(mujoco::mujoco ALIAS mujoco)

src/engine/engine_collision_driver.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,12 @@ extern "C" {
2929
#error "Compiler does not support C11."
3030
#endif
3131
#else
32+
// This ifndef is workaround for https://github.com/deepmind/mujoco/issues/862
33+
// Remove once we can assume that no one uses WIN SDK < 10.0.22000
34+
#ifndef MUJOCO_WINSDK_NO_STDALIGN_H
3235
#include <stdalign.h>
3336
#endif
37+
#endif
3438

3539
struct mjCollisionTree_ {
3640
alignas(mjtNum) int node1;

0 commit comments

Comments
 (0)