pybind / pybind11_bazel

Bazel wrapper around the pybind11 repository
Other
100 stars 54 forks source link

Make `pybind_extension()` work on Windows. #75

Closed junyer closed 7 months ago

junyer commented 7 months ago

Fixes #74.

rwgk commented 7 months ago

For completeness, I think there is still one special situation that's not covered: Windows debug builds.

I found this is some code I worked on a long time ago (but it's still in active use):

  env_etc.extension_module_suffix = ".pyd"
  if (env_etc.compiler == "win32_cl"):
    if hasattr(sys, 'gettotalrefcount'): # only the debug build of Python has this function
      env_etc.extension_module_suffix = "_d.pyd" # then rename extension modules accordingly
                                                 # so that debug version of Python can load them

But I think this is best handled in a separate PR, as needed.

junyer commented 7 months ago

But I think this is best handled in a separate PR, as needed.

Agreed. ;)