mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-23 16:44:22 +08:00
Fix python compilation on windows (#61)
* Polish compilation on Windows * Fix python usage on Windows * fix compile on windows * Update setup.py
This commit is contained in:
@@ -29,7 +29,7 @@ if os.name == "nt":
|
|||||||
add_dll_search_dir(third_libs_dir)
|
add_dll_search_dir(third_libs_dir)
|
||||||
for root, dirs, filenames in os.walk(third_libs_dir):
|
for root, dirs, filenames in os.walk(third_libs_dir):
|
||||||
for d in dirs:
|
for d in dirs:
|
||||||
if d == "lib":
|
if d == "lib" or d == "bin":
|
||||||
add_dll_search_dir(os.path.join(dirname, root, d))
|
add_dll_search_dir(os.path.join(dirname, root, d))
|
||||||
|
|
||||||
from .fastdeploy_main import Frontend, Backend, FDDataType, TensorInfo, Device
|
from .fastdeploy_main import Frontend, Backend, FDDataType, TensorInfo, Device
|
||||||
|
14
setup.py
14
setup.py
@@ -362,6 +362,19 @@ if sys.argv[1] == "install" or sys.argv[1] == "bdist_wheel":
|
|||||||
"fastdeploy/libs/third_libs",
|
"fastdeploy/libs/third_libs",
|
||||||
symlinks=True)
|
symlinks=True)
|
||||||
|
|
||||||
|
third_party_path = os.path.join(".setuptools-cmake-build", "third_party")
|
||||||
|
if os.path.exists(third_party_path):
|
||||||
|
for f in os.listdir(third_party_path):
|
||||||
|
lib_dir_name = os.path.join(third_party_path, f)
|
||||||
|
if os.path.isfile(lib_dir_name):
|
||||||
|
continue
|
||||||
|
for f1 in os.listdir(lib_dir_name):
|
||||||
|
release_dir = os.path.join(lib_dir_name, f1)
|
||||||
|
if f1 == "Release" and not os.path.isfile(release_dir):
|
||||||
|
if os.path.exists(os.path.join("fastdeploy/libs/third_libs", f)):
|
||||||
|
shutil.rmtree(os.path.join("fastdeploy/libs/third_libs", f))
|
||||||
|
shutil.copytree(release_dir, os.path.join("fastdeploy/libs/third_libs", f, "lib"))
|
||||||
|
|
||||||
if platform.system().lower() == "windows":
|
if platform.system().lower() == "windows":
|
||||||
release_dir = os.path.join(".setuptools-cmake-build", "Release")
|
release_dir = os.path.join(".setuptools-cmake-build", "Release")
|
||||||
for f in os.listdir(release_dir):
|
for f in os.listdir(release_dir):
|
||||||
@@ -428,7 +441,6 @@ if sys.argv[1] == "install" or sys.argv[1] == "bdist_wheel":
|
|||||||
all_files = get_all_files("fastdeploy/libs")
|
all_files = get_all_files("fastdeploy/libs")
|
||||||
for f in all_files:
|
for f in all_files:
|
||||||
package_data[PACKAGE_NAME].append(os.path.relpath(f, "fastdeploy"))
|
package_data[PACKAGE_NAME].append(os.path.relpath(f, "fastdeploy"))
|
||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name=PACKAGE_NAME,
|
name=PACKAGE_NAME,
|
||||||
version=VersionInfo.version,
|
version=VersionInfo.version,
|
||||||
|
Reference in New Issue
Block a user