Skip to content

Commit 9cb25f7

Browse files
committed
Skip DLL copy if it already exists at the destination.
Should fix minor crashes when creating development installs.
1 parent 1613480 commit 9cb25f7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

build_sdl.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,10 @@ def get_cdef() -> str:
291291
library_dirs.append(str(SDL2_LIB_DIR))
292292
SDL2_LIB_DEST = Path("tcod", ARCH_MAPPING[BIT_SIZE])
293293
SDL2_LIB_DEST.mkdir(exist_ok=True)
294-
shutil.copy(SDL2_LIB_DIR / "SDL2.dll", SDL2_LIB_DEST)
294+
SDL2_LIB_DEST_FILE = SDL2_LIB_DEST / "SDL2.dll"
295+
SDL2_LIB_FILE = SDL2_LIB_DIR / "SDL2.dll"
296+
if not SDL2_LIB_DEST_FILE.exists() or SDL2_LIB_FILE.read_bytes() != SDL2_LIB_DEST_FILE.read_bytes():
297+
shutil.copy(SDL2_LIB_FILE, SDL2_LIB_DEST_FILE)
295298

296299
# Link to the SDL2 framework on MacOS.
297300
# Delocate will bundle the binaries in a later step.

0 commit comments

Comments
 (0)