Skip to content

Commit ffad8be

Browse files
authored
Provide basic support for FreeBSD (#700)
This PR provides basic support for FreeBSD. For FreeBSD, sys.platform returns freebsdX, and the suffix of shared libraries is .so.
1 parent 5ca84df commit ffad8be

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pygmt/clib/loading.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,14 @@ def clib_names(os_name):
6868
"""
6969
if os_name.startswith("linux"):
7070
libnames = ["libgmt.so"]
71-
elif os_name == "darwin":
72-
# Darwin is macOS
71+
elif os_name == "darwin": # Darwin is macOS
7372
libnames = ["libgmt.dylib"]
7473
elif os_name == "win32":
7574
libnames = ["gmt.dll", "gmt_w64.dll", "gmt_w32.dll"]
75+
elif os_name.startswith("freebsd"): # FreeBSD
76+
libnames = ["libgmt.so"]
7677
else:
77-
raise GMTOSError('Operating system "{}" not supported.'.format(sys.platform))
78+
raise GMTOSError(f'Operating system "{sys.platform}" not supported.')
7879
return libnames
7980

8081

0 commit comments

Comments
 (0)