Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[torchcodec] Pass in CMAKE_BUILD_TYPE from the environment if it is set
Summary: Before this diff we could choose a Debug vs. Release cmake build by passing a flag to setup.py CLI. In modern python projects setup.py is not supposed to be used from the CLI -- pip is used. So in order to pass in the build type to cmake we use an env var. Cmake itself does accept the environment variable in addiion to the flag for CMAKE_BUILD_TYPE. The reason we get the env var in setup.py and pass it down to cmake manually is we want to make sure Release is the default. By default CMAKE_BUILD_TYPE is set to nothing, which is different from "Debug" or "Release": https://cmake.org/cmake/help/v3.22/manual/cmake-buildsystem.7.html#default-and-custom-configurations > The default value will often be none of the above standard configurations and will instead be an empty string. A common misunderstanding is that this is the same as Debug, but that is not the case. Users should always explicitly specify the build type instead to avoid this common problem. Reviewed By: NicolasHug Differential Revision: D58730309 fbshipit-source-id: fcd7fe1e1f17a9d45dc9da2efefa00af4fd29b41
- Loading branch information