2 Commits

Author SHA1 Message Date
Esun Kim
ea16833187 [C++] Fix python build script to handle C and C++ std options properly for MSVC (#38410)
This PR makes necessary changes to Python build scripts for C++17 support, which were missed in #37919

- Fixed handling of C and C++ standard options for MSVC.
  - Previously, a workaround relied on a specific method, `_compiler` found in the compiler class. [unixcompiler](ff11eed0c3/distutils/unixccompiler.py (L191)) has it but [msvccompiler](ff11eed0c3/distutils/_msvccompiler.py (L367)) doesn't. Therefore this won't work for MSVC even though it's supposed to work across all compilers.
  - To resolve this, a new workaround has been implemented. This involves adding logic directly into the `_commandfile_spawn` function, which is considered the most suitable location for this fix. Although not ideal, this ensures that C and C++ standard options are managed correctly for MSVC.
- Removed `compiler_ok_with_extra_std function` as isolating C and C++ standard options is always recommended.
- Updated comments to correctly refer to C++17.

Closes #38410

PiperOrigin-RevId: 713442384
2025-01-08 15:48:59 -08:00
Esun Kim
2fc3847f0e [Build] Apply _spawn_patch.py to grpcio_tools (#37074)
grpcio_tool now needs `_spawn_patch.py` to workaround the length limit of commandline on Windows. This is a prerequisite for https://github.com/grpc/grpc/pull/36753.

Closes #37074

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37074 from veblush:grpcio_build 9ba7b4462c82d961b6c2d0adcf9fd8ace14b7461
PiperOrigin-RevId: 647405460
2024-06-27 12:22:31 -07:00