From b6eee4918f4345bdf912f8910a87a280fe6d3825 Mon Sep 17 00:00:00 2001 From: Jukka Lehtosalo Date: Sun, 6 Oct 2024 15:25:57 +0100 Subject: [PATCH] [mypyc] Make C unit tests faster by compiling with -O0 Most time is spent in compilation, so runtime performance doesn't really matter. --- mypyc/test/test_external.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mypyc/test/test_external.py b/mypyc/test/test_external.py index 22eb8019133c..010c74dee42e 100644 --- a/mypyc/test/test_external.py +++ b/mypyc/test/test_external.py @@ -20,7 +20,9 @@ def test_c_unit_test(self) -> None: cppflags: list[str] = [] env = os.environ.copy() if sys.platform == "darwin": - cppflags += ["-mmacosx-version-min=10.10", "-stdlib=libc++"] + cppflags += ["-O0", "-mmacosx-version-min=10.10", "-stdlib=libc++"] + elif sys.platform == "linux": + cppflags += ["-O0"] env["CPPFLAGS"] = " ".join(cppflags) # Build Python wrapper for C unit tests.