Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build] Restore Windows constexpr mutex define #7502

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cmake/modules/CompileWarnings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,9 @@ macro(wpilib_target_warnings target)
)
target_compile_options(${target} PRIVATE -gz=zlib)
endif()

# Disable std::mutex constexpr constructor on MSVC
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually don't think the CMake builds need this, but its probably fine.

if(MSVC)
target_compile_options(${target} PRIVATE /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR)
endif()
endmacro()
3 changes: 3 additions & 0 deletions shared/bazel/compiler_flags/windows_flags.rc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ build:windows --config=windows_common

build:windows --linkopt=/DEPENDENTLOADFLAG:0x1100

# TODO
build:windows --copt=/D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR

################################
# ARM Windows Flags
################################
Expand Down
5 changes: 5 additions & 0 deletions shared/config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,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")

if (project.hasProperty('ntcoreffibuild')) {
Expand Down
Loading