wjakob / nanobind

nanobind: tiny and efficient C++/Python bindings
BSD 3-Clause "New" or "Revised" License
2.14k stars 161 forks source link

Use cmake-style path in nanobind_add_stub #620

Closed metab0t closed 2 weeks ago

metab0t commented 2 weeks ago

The path of Python executable should be converted to cmake-style path to avoid invalid escape sequence.

Otherwise, NB_STUBGEN_CMD may contain string like D:\mambaforge\python.exe on Windows and will make this line writes incorrect string: https://github.com/wjakob/nanobind/blob/c5ae2a36a704c1c62da99a81fad919261a3e9848/cmake/nanobind-config.cmake#L446

wjakob commented 2 weeks ago

Thanks!