Add ability to copy prebuilt libraries from prebuilt directory during python build
diff --git a/bindings/python/prebuilt/.gitkeep b/bindings/python/prebuilt/.gitkeep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bindings/python/prebuilt/.gitkeep
diff --git a/bindings/python/setup.py b/bindings/python/setup.py
index f3bceb8..072adbe 100755
--- a/bindings/python/setup.py
+++ b/bindings/python/setup.py
@@ -117,6 +117,14 @@
# copy public headers
shutil.copytree(os.path.join(BUILD_DIR, 'include'), os.path.join(HEADERS_DIR, 'capstone'))
+ # if prebuilt libraries are available, use those and cancel build
+ if os.path.exists(os.path.join(ROOT_DIR, 'prebuilt', LIBRARY_FILE)) and \
+ (not STATIC_LIBRARY_FILE or os.path.exists(os.path.join(ROOT_DIR, 'prebuilt', STATIC_LIBRARY_FILE))):
+ shutil.copy(os.path.join(ROOT_DIR, 'prebuilt', LIBRARY_FILE), LIBS_DIR)
+ if STATIC_LIBRARY_FILE is not None:
+ shutil.copy(os.path.join(ROOT_DIR, 'prebuilt', STATIC_LIBRARY_FILE), LIBS_DIR)
+ return
+
os.chdir(BUILD_DIR)
# platform description refers at https://docs.python.org/2/library/sys.html#sys.platform