diff --git a/pyproject.toml b/pyproject.toml index 408cd00bf..4e0964295 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,9 @@ [build-system] requires = ["setuptools", "wheel", "pybind11~=2.11.1"] build-backend = "setuptools.build_meta" + +[tool.cibuildwheel.windows.environment] +# CAUTION! This is /Od instead of /O2 because of bugs in the msvc compiler! +# See: https://github.com/quantumlib/Stim/issues/1078 +CFLAGS = "/Od" +CXXFLAGS = "/Od" diff --git a/setup.py b/setup.py index a310d368f..8305e8359 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,9 @@ if platform.system().startswith('Win'): common_compile_args = [ '/std:c++20', - '/O2', + # CAUTION! This is /Od instead of /O2 because of bugs in the msvc compiler! + # See: https://github.com/quantumlib/Stim/issues/1078 + '/Od', f'/DVERSION_INFO={__version__}', ] arch_avx = ['/arch:AVX2']