From bbed12487d1aa0ecb42a5bc195eee0593b792910 Mon Sep 17 00:00:00 2001
From: David Hoese <david.hoese@ssec.wisc.edu>
Date: Tue, 10 Sep 2024 15:32:49 -0500
Subject: [PATCH] Use extra_compile_args for working aroung old agg code

---
 setup.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/setup.py b/setup.py
index 72ac817..e3b254a 100644
--- a/setup.py
+++ b/setup.py
@@ -146,6 +146,9 @@ def _get_freetype_with_pkgconfig():
 if sys.platform == "win32":
     libraries.extend(["kernel32", "user32", "gdi32"])
 
+# agg C++ is not compatible with gcc 14
+extra_compile_args = ["-fpermissive"]
+
 setup(
     name="aggdraw",
     version=VERSION,
@@ -165,7 +168,8 @@ def _get_freetype_with_pkgconfig():
         Extension("aggdraw", ["aggdraw.cxx"] + sources,
                   define_macros=defines,
                   include_dirs=include_dirs,
-                  library_dirs=library_dirs, libraries=libraries
+                  library_dirs=library_dirs, libraries=libraries,
+                  extra_compile_args=extra_compile_args,
                   )
         ],
     python_requires='>=3.9',