Skip to content

Commit 3e3500d

Browse files
authored
Merge pull request #1310 from maharshi-gor/macOS-warning-fix
BF: macOS glfw warning fix
2 parents d2beab4 + ad5cbdb commit 3e3500d

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

fury/__init__.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
"""Init file for visualization package."""
22

3-
from os.path import dirname
3+
from importlib.util import find_spec
4+
import os
5+
from os.path import dirname, join
46
import sys
57
import warnings
68

@@ -9,6 +11,13 @@
911
from fury.optpkg import optional_package
1012
from fury.pkg_info import __version__, pkg_commit_hash
1113

14+
if sys.platform == "darwin" and not os.environ.get("PYGLFW_LIBRARY"):
15+
_imgui_spec = find_spec("imgui_bundle")
16+
if _imgui_spec and _imgui_spec.submodule_search_locations:
17+
_lib = join(_imgui_spec.submodule_search_locations[0], "libglfw.3.dylib")
18+
if os.path.exists(_lib):
19+
os.environ["PYGLFW_LIBRARY"] = _lib
20+
1221
__getattr__, __dir__, __all__ = lazy.attach_stub(__name__, __file__)
1322

1423
__all__ += [

0 commit comments

Comments
 (0)