From 5e7469d9bf56bb10064209d5f8d6a5a65dcdc721 Mon Sep 17 00:00:00 2001 From: Jan Funke Date: Sun, 26 Jul 2026 11:20:41 +0200 Subject: [PATCH] Prepend extra compile args to user given list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …and therefore don't change it in place, otherwise subsequent calls will accumulate extra arguments, which results in different hashes. --- src/witty/compile_module.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/witty/compile_module.py b/src/witty/compile_module.py index 4b49407..a5caa23 100644 --- a/src/witty/compile_module.py +++ b/src/witty/compile_module.py @@ -172,22 +172,22 @@ def build_extra_objects(build_dir: Path) -> list[str]: extra_compile_args = [] # Use MSVC style flag on Windows, GCC/Clang flags otherwise if sys.platform == "win32": - extra_compile_args += [ + extra_compile_args = [ "/std:c++17", "/DNDEBUG", "/DNB_COMPACT_ASSERTIONS", "/O2", "/EHsc", - ] + ] + extra_compile_args else: - extra_compile_args += [ + extra_compile_args = [ "-std=c++17", "-fvisibility=hidden", "-DNDEBUG", "-DNB_COMPACT_ASSERTIONS", "-fPIC", "-O3", - ] + ] + extra_compile_args return _compile_module( source,