Skip to content
Snippets Groups Projects
Commit b937dd81 authored by Daniel Salzman's avatar Daniel Salzman
Browse files

python: add platform detection to fix default library name on macOS

parent 3e99dc7a
Branches
Tags
No related merge requests found
Pipeline #10117 passed with stages
in 11 minutes and 35 seconds
......@@ -130,7 +130,7 @@ html_logo = 'logo.png'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
html_use_smartypants = False
#html_use_smartypants = False
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
......
......@@ -27,6 +27,7 @@ Example:
from ctypes import cdll, c_void_p, c_int, c_char_p, c_uint, byref
from enum import IntEnum
from sys import platform
CTL_ALLOC = None
CTL_FREE = None
......@@ -38,9 +39,11 @@ CTL_RECEIVE = None
CTL_ERROR = None
def load_lib(path="libknot.so"):
def load_lib(path=None):
"""Loads the libknot library."""
if path is None:
path = "libknot.dylib" if sys.platform == "darwin" else "libknot.so"
LIB = cdll.LoadLibrary(path)
global CTL_ALLOC
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment