pytorch/cmake
Su, Tong 60523540f1 Force build to conform C++ standard on windows by adding /permissive- flag (#149035)
Fixes #147366

1. Add `/permissive-` to the `torch_compile_options` for the build to conform to the C++ standard.
2. Fix the error when trying to assign a string literal to a non-const ptr.

The `/permissive-` flag can be found at https://learn.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance?view=msvc-170

From the above [doc](https://learn.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance?view=msvc-170#remarks),
>  By default, the /permissive- option is set in new projects created by Visual Studio 2017 version 15.5 and later versions.
> The /permissive- option is implicitly set by the /std:c++latest option starting in Visual Studio 2019 version 16.8, and in version 16.11 by the /std:c++20 option.

Thus, it is reasonable to add this flag to the existing project.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/149035
Approved by: https://github.com/guangyey, https://github.com/malfet
2025-03-18 01:51:46 +00:00
..
External [ROCm] Bump AOTriton to 0.9.2b (#148433) 2025-03-07 22:10:07 +00:00
Modules [ROCm][Windows] Fix OpenMP Flags for clang-cl (#148097) 2025-03-10 22:47:15 +00:00
Modules_CUDA_fix [NVIDIA] Full Family Blackwell Support codegen (#145436) 2025-01-24 04:36:00 +00:00
public Force build to conform C++ standard on windows by adding /permissive- flag (#149035) 2025-03-18 01:51:46 +00:00
Allowlist.cmake
BuildVariables.cmake
Caffe2Config.cmake.in [Submodule] Remove third-party onnx-tensorrt (#126542) 2024-05-19 22:34:24 +00:00
CheckAbi.cmake remove abi uncertainty and potential abi conflict (#94306) 2023-02-09 09:54:04 +00:00
cmake_uninstall.cmake.in
Codegen.cmake Fix atomic operation compatibility for ARMv8-A (Raspberry Pi 4) by adjusting compilation flags (#148070) 2025-03-15 00:02:38 +00:00
DebugHelper.cmake
Dependencies.cmake [ROCm][Windows] Enable hipblaslt for Windows (#148563) 2025-03-10 21:07:16 +00:00
FlatBuffers.cmake
GoogleTestPatch.cmake Simplify cmake code (#91546) 2023-02-08 01:05:19 +00:00
IncludeSource.cpp.in
iOS.cmake [executorch] Update iOS toolchain with a modern cmake syntax. (#115799) 2023-12-15 00:51:30 +00:00
Metal.cmake [MPS] Support includes in metal objects (#145087) 2025-01-18 05:35:22 +00:00
MiscCheck.cmake Remove CAFFE2_USE_EXCEPTION_PTR (#147247) 2025-03-06 02:56:23 +00:00
prioritized_text.txt [Build] Add linker script optimization (#121975) 2024-04-09 20:22:25 +00:00
ProtoBuf.cmake [BE] Cleanup CMake flag suppressions (#97584) 2023-03-27 18:46:09 +00:00
ProtoBufPatch.cmake Migrate PyTorch to C++17 (#85969) 2022-12-08 02:27:48 +00:00
Summary.cmake Revert "Reverting the PR adding Kleidiai-based int4 kernels (#145392)" (#145505) 2025-01-23 18:50:59 +00:00
TorchConfig.cmake.in Revert "Reverting the PR adding Kleidiai-based int4 kernels (#145392)" (#145505) 2025-01-23 18:50:59 +00:00
TorchConfigVersion.cmake.in
VulkanCodegen.cmake [BE][CMake] Use FindPython module (#124613) 2024-05-29 13:17:35 +00:00
VulkanDependencies.cmake [Vulkan] Remove GLSL Code Gen (#91912) 2023-01-10 20:29:47 +00:00