Copy .lib files on Windows

This commit is contained in:
Ben Visness 2023-07-15 18:39:44 -05:00 committed by Ben Visness
parent 25782ccc77
commit 4337b9bffa
1 changed files with 9 additions and 5 deletions

View File

@ -211,7 +211,9 @@ def ensure_angle():
if platform.system() == "Windows": if platform.system() == "Windows":
checkfiles = [ checkfiles = [
"milepost/lib/libEGL.dll", "milepost/lib/libEGL.dll",
"milepost/lib/libEGL.dll.lib",
"milepost/lib/libGLESv2.dll", "milepost/lib/libGLESv2.dll",
"milepost/lib/libGLESv2.dll.lib",
] ]
elif platform.system() == "Darwin": elif platform.system() == "Darwin":
if platform.machine() == "arm64": if platform.machine() == "arm64":
@ -245,11 +247,11 @@ def download_angle():
print("Downloading ANGLE...") print("Downloading ANGLE...")
if platform.system() == "Windows": if platform.system() == "Windows":
build = "windows-2019" build = "windows-2019"
extension = "dll" extensions = ["dll", "lib"]
elif platform.system() == "Darwin": elif platform.system() == "Darwin":
# TODO(ben): make universal dylibs # TODO(ben): make universal dylibs
build = "macos-12" build = "macos-12"
extension = "dylib" extensions = ["dylib"]
else: else:
log_error(f"could not automatically download ANGLE for unknown platform {platform.system()}") log_error(f"could not automatically download ANGLE for unknown platform {platform.system()}")
return return
@ -270,8 +272,10 @@ def download_angle():
with ZipFile(filepath, "r") as anglezip: with ZipFile(filepath, "r") as anglezip:
anglezip.extractall(path="scripts/files") anglezip.extractall(path="scripts/files")
for filepath in glob.glob(f"scripts/files/angle/bin/*.{extension}"):
os.makedirs("milepost/lib", exist_ok=True) os.makedirs("milepost/lib", exist_ok=True)
for angleDir in ["bin", "lib"]:
for ext in extensions:
for filepath in glob.glob(f"scripts/files/angle/{angleDir}/*.{ext}"):
shutil.copy(filepath, "milepost/lib") shutil.copy(filepath, "milepost/lib")