Skip to content

Commit 5e522f6

Browse files
committed
ARM macOS support
1 parent 0cfc4ef commit 5e522f6

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

CMakeLists.txt

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.21)
22
set(CMAKE_CXX_STANDARD 20)
33
set(CMAKE_CXX_STANDARD_REQUIRED ON)
4-
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
4+
set(CMAKE_OSX_ARCHITECTURES "arm64")
55
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
66

77
if (MSVC)
@@ -83,7 +83,18 @@ elseif (ANDROID)
8383
) # android
8484
endif()
8585
else ()
86-
set(STATIC_LIBS ...) # macos
86+
find_package(BZIP2 REQUIRED)
87+
set(STATIC_LIBS
88+
"-framework Security"
89+
${CMAKE_SOURCE_DIR}/lib/libx264.a
90+
${CMAKE_SOURCE_DIR}/lib/libavcodec.a
91+
${CMAKE_SOURCE_DIR}/lib/libavformat.a
92+
${CMAKE_SOURCE_DIR}/lib/libavutil.a
93+
${CMAKE_SOURCE_DIR}/lib/libswresample.a
94+
${CMAKE_SOURCE_DIR}/lib/libswscale.a
95+
${BZIP2_LIBRARY}
96+
"-lm -lbz2 -lz -liconv -pthread -framework Security -framework VideoToolbox -framework CoreFoundation -framework CoreMedia -framework CoreVideo -framework CoreServices -framework CoreAudio -framework AVFoundation -framework CoreGraphics -framework AudioToolbox -framework Metal -framework CoreImage -framework AppKit"
97+
) # macos
8798
endif()
8899
target_link_libraries(${PROJECT_NAME} ${STATIC_LIBS})
89100

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,23 @@ You can either run it natively on Linux or using WSL on Windows.
7575
When building for android32 you need to set android version 24, you can do so by adding this arg to your geode build command
7676
```sh
7777
geode build --platform android32 --config Release -- -DANDROID_PLATFORM=24
78+
```
79+
80+
## MacOS
81+
To get the needed libraries on MacOS, you must have pkg-config installed, have BZIP2, and build x264 from source.
82+
83+
```sh
84+
brew install pkgconfig
85+
brew install bzip2
86+
87+
git clone https://code.videolan.org/videolan/x264.git
88+
cd x264
89+
./configure --enable-static --enable-shared
90+
make
91+
92+
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
93+
brew install automake fdk-aac git lame libass libtool libvorbis libvpx opus sdl shtool texi2html theora wget x264 x265 xvid nasm
94+
mkdir output
95+
./configure --prefix=$PWD/output --enable-static --enable-shared --enable-libx264 --enable-gpl
96+
make
7897
```

0 commit comments

Comments
 (0)