mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
Summary: As explained in https://github.com/pytorch/pytorch/issues/41922 using `if(NOT ${var})" is usually wrong and can lead to issues like https://github.com/pytorch/pytorch/issues/41922 where the condition is wrongly evaluated to FALSE instead of TRUE. Instead the unevaluated variable name should be used in all cases, see the CMake docu for details. This fixes the `NOT ${var}` cases by using a simple regexp replacement. It seems `pybind11_PREFER_third_party` is the only variable really prone to causing an issue as all others are set. However due to CMake evaluating unquoted strings in `if` conditions as variable names I recommend to never use unquoted `${var}` in an if condition. A similar regexp based replacement could be done on the whole codebase but as that does a lot of changes I didn't include this now. Also `if(${var})` will likely lead to a parser error if `var` is unset instead of a wrong result Fixes https://github.com/pytorch/pytorch/issues/41922 Pull Request resolved: https://github.com/pytorch/pytorch/pull/41924 Reviewed By: seemethere Differential Revision: D22700229 Pulled By: mrshenli fbshipit-source-id: e2b3466039e4312887543c2e988270547a91c439 |
||
|---|---|---|
| .. | ||
| External | ||
| Modules | ||
| Modules_CUDA_fix | ||
| public | ||
| BuildVariables.cmake | ||
| Caffe2Config.cmake.in | ||
| Caffe2ConfigVersion.cmake.in | ||
| cmake_uninstall.cmake.in | ||
| Codegen.cmake | ||
| Dependencies.cmake | ||
| GoogleTestPatch.cmake | ||
| iOS.cmake | ||
| MiscCheck.cmake | ||
| ProtoBuf.cmake | ||
| ProtoBufPatch.cmake | ||
| Summary.cmake | ||
| TorchConfig.cmake.in | ||
| TorchConfigVersion.cmake.in | ||
| Utils.cmake | ||
| VulkanCodegen.cmake | ||
| VulkanDependencies.cmake | ||
| Whitelist.cmake | ||