diff --git a/cmake/modules/CompileWarnings.cmake b/cmake/modules/CompileWarnings.cmake index 94d952ce5d..432c810ca9 100644 --- a/cmake/modules/CompileWarnings.cmake +++ b/cmake/modules/CompileWarnings.cmake @@ -54,4 +54,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() diff --git a/shared/config.gradle b/shared/config.gradle index 6c4f3942b4..1d184295af 100644 --- a/shared/config.gradle +++ b/shared/config.gradle @@ -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 {