Skip to content

Commit

Permalink
[build] Disable std::mutex constexpr constructor on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
rzblue committed Jun 30, 2024
1 parent a2beb75 commit 05ca80f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmake/modules/CompileWarnings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,9 @@ macro(wpilib_target_warnings target)
)
target_compile_options(${target} PRIVATE -gz=zlib)
endif()

# Disable std::mutex constexpr constructor on MSVC
if(MSVC)
target_compile_options(${target} PRIVATE /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR)
endif()
endmacro()
5 changes: 5 additions & 0 deletions shared/config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ nativeUtils.platformConfigs.each {
}
}

// Disable std::mutex constexpr constructor on MSVC
nativeUtils.platformConfigs.named(nativeUtils.wpi.platforms.windowsx64).configure {
it.cppCompiler.args.add("/D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR")
}

nativeUtils.platformConfigs.linuxathena.linker.args.add("-Wl,--fatal-warnings")

model {
Expand Down

0 comments on commit 05ca80f

Please sign in to comment.