build-aux: use copy2 instead of copyfile

This commit is contained in:
Stéphane Cerveau 2023-09-18 10:29:11 +02:00
parent 40e999f7d1
commit 111750a33b

View file

@ -22,11 +22,11 @@ if BUILDTYPE == "release":
print("RELEASE MODE") print("RELEASE MODE")
CMD = ['cargo', 'build', '--manifest-path', os.path.join(MESON_SOURCE_ROOT, 'Cargo.toml'), '--release'] CMD = ['cargo', 'build', '--manifest-path', os.path.join(MESON_SOURCE_ROOT, 'Cargo.toml'), '--release']
subprocess.run(CMD, env=env) subprocess.run(CMD, env=env)
shutil.copyfile(os.path.join(CARGO_TARGET_DIR, "release", APP_BIN), OUTPUT) shutil.copy2(os.path.join(CARGO_TARGET_DIR, "release", APP_BIN), OUTPUT)
else: else:
print("DEBUG MODE") print("DEBUG MODE")
CMD = ['cargo', 'build', '--manifest-path', os.path.join(MESON_SOURCE_ROOT, 'Cargo.toml')] CMD = ['cargo', 'build', '--manifest-path', os.path.join(MESON_SOURCE_ROOT, 'Cargo.toml')]
subprocess.run(CMD, env=env) subprocess.run(CMD, env=env)
shutil.copyfile(os.path.join(CARGO_TARGET_DIR, "debug", APP_BIN), OUTPUT) shutil.copy2(os.path.join(CARGO_TARGET_DIR, "debug", APP_BIN), OUTPUT)