mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-06 09:07:10 +08:00
[win] fix windows process_libraries (#173)
* [win] fix windows process_libraries * [win] fix windows process_libraries
This commit is contained in:
@@ -55,7 +55,8 @@ def process_on_mac(current_dir):
|
|||||||
filename = os.path.join(libs_path, f)
|
filename = os.path.join(libs_path, f)
|
||||||
if not os.path.isfile(filename):
|
if not os.path.isfile(filename):
|
||||||
continue
|
continue
|
||||||
if f.count("fastdeploy") and (f.count(".dylib") > 0 or f.count(".so") > 0):
|
if f.count("fastdeploy") > 0 and (f.count(".dylib") > 0 or
|
||||||
|
f.count(".so") > 0):
|
||||||
fd_libs.append(filename)
|
fd_libs.append(filename)
|
||||||
|
|
||||||
pre_commands = list()
|
pre_commands = list()
|
||||||
@@ -88,6 +89,7 @@ def process_on_mac(current_dir):
|
|||||||
assert subprocess.Popen(
|
assert subprocess.Popen(
|
||||||
cmd, shell=True) != 0, "Execute command failed: {}".format(cmd)
|
cmd, shell=True) != 0, "Execute command failed: {}".format(cmd)
|
||||||
|
|
||||||
|
|
||||||
def process_on_windows(current_dir):
|
def process_on_windows(current_dir):
|
||||||
libs_path = os.path.join(current_dir, "fastdeploy", "libs")
|
libs_path = os.path.join(current_dir, "fastdeploy", "libs")
|
||||||
third_libs_path = os.path.join(libs_path, "third_libs")
|
third_libs_path = os.path.join(libs_path, "third_libs")
|
||||||
@@ -97,6 +99,7 @@ def process_on_windows(current_dir):
|
|||||||
if f.count('onnxruntime') > 0 and f.endswith('.dll'):
|
if f.count('onnxruntime') > 0 and f.endswith('.dll'):
|
||||||
shutil.copy(file_path, libs_path)
|
shutil.copy(file_path, libs_path)
|
||||||
|
|
||||||
|
|
||||||
def get_all_files(dirname):
|
def get_all_files(dirname):
|
||||||
files = list()
|
files = list()
|
||||||
for root, dirs, filenames in os.walk(dirname):
|
for root, dirs, filenames in os.walk(dirname):
|
||||||
@@ -116,6 +119,15 @@ def process_libraries(current_dir):
|
|||||||
|
|
||||||
all_files = get_all_files(os.path.join(current_dir, "fastdeploy", "libs"))
|
all_files = get_all_files(os.path.join(current_dir, "fastdeploy", "libs"))
|
||||||
package_data = list()
|
package_data = list()
|
||||||
|
|
||||||
|
if platform.system().lower() == "windows":
|
||||||
|
for f in all_files:
|
||||||
|
if f.endswith(".pyd") or f.endswith("lib") or f.endswith("dll"):
|
||||||
|
package_data.append(
|
||||||
|
os.path.relpath(f, os.path.join(current_dir,
|
||||||
|
"fastdeploy")))
|
||||||
|
return package_data
|
||||||
|
|
||||||
filters = [".vcxproj", ".png", ".java", ".h", ".cc", ".cpp", ".hpp"]
|
filters = [".vcxproj", ".png", ".java", ".h", ".cc", ".cpp", ".hpp"]
|
||||||
for f in all_files:
|
for f in all_files:
|
||||||
remain = True
|
remain = True
|
||||||
|
Reference in New Issue
Block a user