AcademySoftwareFoundation / OpenShadingLanguage

Advanced shading language for production GI renderers
BSD 3-Clause "New" or "Revised" License
2.07k stars 350 forks source link

Fix builds when USE_PYTHON=OFF #1675

Closed DeclanRussell closed 1 year ago

DeclanRussell commented 1 year ago

Description

This issue was caused by https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/commit/5efe15a79eb2d29a0f526f4c7e43c6f483b39d15. Essentially, we now use Python_EXECUTABLE to execute the serialize-bc.py script. Therefore, we have to run find_package(python) so that the Python_EXECUTABLE variable gets setup.

Checklist:

lgritz commented 1 year ago

Is there anybody for whom it might cause trouble for python to be a required dependency, as I believe this change effectively makes it? I don't necessarily have any objections, but just making sure we are aware of that changes we are implicitly proposing.

DeclanRussell commented 1 year ago

If there are people whom having python as a dependency is an issue, then they would already be hitting the problem before this change. Using the Python_EXECUTABLE variable currently means that you have to build with USE_PYTHON=ON, otherwise the build will fail. To remove that limitation, we would need to revert the Python_EXECUTABLE changes introduced by https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/commit/5efe15a79eb2d29a0f526f4c7e43c6f483b39d15 , but even then, the build would instead just fail trying to execute the python scripts instead if you don't have python installed on your machine.

lgritz commented 1 year ago

No, I think that's reasonable. I guess we're saying that you need Python in order to build OSL or to run the testsuite, but not just to run it.