Skip to content

Commit

Permalink
Create Windows.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilkrzyskow authored Feb 29, 2024
1 parent 7c6ae39 commit 49f40c4
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Windows.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import os

library_names = ("cairo-2.dll", "cairo.dll", "libcairo-2.dll")
filenames = ("libcairo.so.2", "libcairo.2.dylib", "libcairo-2.dll")
found_path = ""

for name in library_names:
for path in os.environ['PATH'].split(os.pathsep):
resolved_path = os.path.join(path, name)
print(resolved_path)
if os.path.exists(resolved_path):
filenames = (resolved_path, ) + filenames
found_path = resolved_path
break
if found_path:
break
else:
found_path = "not found"

print(f"The path is {found_path}")
print("List of files that FFI will try to load:")
for filename in filenames:
print("-", filename)

0 comments on commit 49f40c4

Please sign in to comment.