Commit 7a3b39e
authored
setup.py: fix cross-compilation on macOS hosts (#247)
When cross-compiling for a non-macOS target (such as Linux) on a macOS host, setup.py incorrectly detects the host platform as 'darwin' using sys.platform. This adds the macOS-specific flag -iwithsysroot/usr/include/ffi to the compiler arguments, which causes the cross-compiler to fail with:
aarch64-openwrt-linux-musl-gcc: error: unrecognized command-line option '-iwithsysroot/usr/include/ffi'
By using sysconfig.get_platform().startswith('macosx') instead of 'darwin' in sys.platform, we correctly check the target platform rather than the build host. This allows successful cross-compilation on macOS hosts.1 parent fe99742 commit 7a3b39e
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| |||
0 commit comments