Skip to content

Commit 21e7cf7

Browse files
committed
Create Universal binary for macOS
1 parent ddfc1d4 commit 21e7cf7

4 files changed

Lines changed: 7 additions & 13 deletions

File tree

Main.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,7 @@ def compress_rom(input_file: str, output_file: str, delete_input: bool = False)
235235
else:
236236
compressor_path += "Compress"
237237
elif platform.system() == 'Darwin':
238-
if platform.machine() == 'arm64':
239-
compressor_path += "Compress_ARM64.out"
240-
else:
241-
compressor_path += "Compress.out"
238+
compressor_path += "Compress.out"
242239
else:
243240
logger.info("OS not supported for ROM compression.")
244241
raise Exception("This operating system does not support ROM compression. You may only output patch files or uncompressed ROMs.")

bin/Compress/Compress.out

48.4 KB
Binary file not shown.

bin/Compress/Compress_ARM64.out

-35.6 KB
Binary file not shown.

bin/Compress/README.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,15 @@ pacman -S mingw-w64-i686-toolchain # only needs to be run once (installs the too
3131
gcc bin/Compress/src/compressor.c -o bin/Compress/Compress32.exe
3232
```
3333

34-
# macOS (ARM64)
34+
# macOS (Universal)
3535

36-
```zsh
37-
clang -pthread bin/Compress/src/compressor.c -o bin/Compress/Compress_ARM64.out
38-
```
39-
40-
# macOS (x86_64)
41-
42-
Can be cross-compiled from ARM64.
36+
Compile on ARM64 (Apple Silicon).
4337

4438
```zsh
45-
clang -arch x86_64 -pthread bin/Compress/src/compressor.c -o bin/Compress/Compress.out
39+
clang -pthread bin/Compress/src/compressor.c -o bin/Compress/Compress_ARM64.out
40+
clang -arch x86_64 -pthread bin/Compress/src/compressor.c -o bin/Compress/Compress_x86_64.out
41+
lipo -create bin/Compress/Compress_ARM64.out bin/Compress/Compress_x86_64.out -output bin/Compress/Compress.out
42+
rm bin/Compress/Compress_ARM64.out bin/Compress/Compress_x86_64.out
4643
```
4744

4845
# Linux (ARM64)

0 commit comments

Comments
 (0)