Better LDFLAGS and CFLAGS for win32 an MACOS
authorEdouard Tisserant <edouard.tisserant@gmail.com>
Wed, 10 May 2023 17:02:05 +0200
changeset 3799 2b995a4963a4
parent 3798 e0117f4b0ff1
child 3800 a5a6ee271e65
Better LDFLAGS and CFLAGS for win32 an MACOS
targets/OSX/__init__.py
targets/Win32/__init__.py
--- a/targets/OSX/__init__.py	Wed May 10 17:00:04 2023 +0200
+++ b/targets/OSX/__init__.py	Wed May 10 17:02:05 2023 +0200
@@ -24,6 +24,7 @@
 
 
 from ..toolchain_gcc import toolchain_gcc
+import platform
 
 
 class OSX_target(toolchain_gcc):
@@ -34,7 +35,7 @@
         return toolchain_gcc.getBuilderCFLAGS(self) + \
             ["-fPIC", "-Wno-deprecated-declarations",
              "-Wno-implicit-function-declaration", "-Wno-int-conversion",
-             "-Wno-parentheses-equality", "-Wno-varargs"]
+             "-Wno-parentheses-equality", "-Wno-varargs", "-arch", platform.machine()]
 
     def getBuilderLDFLAGS(self):
-        return toolchain_gcc.getBuilderLDFLAGS(self) + ["-shared"]
+        return toolchain_gcc.getBuilderLDFLAGS(self) + ["-shared", "-arch", platform.machine()]
--- a/targets/Win32/__init__.py	Wed May 10 17:00:04 2023 +0200
+++ b/targets/Win32/__init__.py	Wed May 10 17:02:05 2023 +0200
@@ -31,5 +31,9 @@
     dlopen_prefix = ""
     extension = ".dll"
 
+    def getBuilderCFLAGS(self):
+        return toolchain_gcc.getBuilderCFLAGS(self) + \
+            ["-Wno-implicit-function-declaration", "-Wno-int-conversion"]
+
     def getBuilderLDFLAGS(self):
         return toolchain_gcc.getBuilderLDFLAGS(self) + ["-shared", "-lwinmm"]