diff --git a/.bazelrc b/.bazelrc index 5965f963f4..8544a624e1 100644 --- a/.bazelrc +++ b/.bazelrc @@ -32,6 +32,11 @@ build:linux --define=xnn_enable_avx512amx=false build:windows --cxxopt=/std:c++20 build:windows --host_cxxopt=/std:c++20 build:windows --copt=/w +# Fix MSVC preprocessor compatibility (Fixes MP_STATUS_MACROS_IMPL_REM error) +build:windows --copt=/Zc:preprocessor +build:windows --host_copt=/Zc:preprocessor +# Ensure stable Python version for Windows builds (Avoids Python 3.13 crash) +build:windows --repo_env=HERMETIC_PYTHON_VERSION=3.12 # For using M_* math constants on Windows with MSVC. build:windows --copt=/D_USE_MATH_DEFINES build:windows --host_copt=/D_USE_MATH_DEFINES diff --git a/mediapipe/gpu/gpu_service.cc b/mediapipe/gpu/gpu_service.cc index 53a0e0f479..681b7c44eb 100644 --- a/mediapipe/gpu/gpu_service.cc +++ b/mediapipe/gpu/gpu_service.cc @@ -16,7 +16,7 @@ namespace mediapipe { -const GraphService kGpuService( +constinit const GraphService kGpuService( "kGpuService", GraphServiceBase::kAllowDefaultInitialization); } // namespace mediapipe diff --git a/mediapipe/gpu/gpu_service.h b/mediapipe/gpu/gpu_service.h index dd3bd3bf5b..99c015e012 100644 --- a/mediapipe/gpu/gpu_service.h +++ b/mediapipe/gpu/gpu_service.h @@ -30,7 +30,7 @@ class GpuResources { }; #endif // MEDIAPIPE_DISABLE_GPU -ABSL_CONST_INIT extern const GraphService kGpuService; +ABSL_CONST_INIT extern constinit const GraphService kGpuService; } // namespace mediapipe