From 5e522f6326114a72068f7290bfe771f360578bfd Mon Sep 17 00:00:00 2001 From: ninXout <58670749+ninXout@users.noreply.github.com> Date: Wed, 16 Oct 2024 11:22:22 -0400 Subject: [PATCH] ARM macOS support --- CMakeLists.txt | 15 +++++++++++++-- README.md | 19 +++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ef7c5b6..ae53df6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.21) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64") +set(CMAKE_OSX_ARCHITECTURES "arm64") set(CMAKE_CXX_VISIBILITY_PRESET hidden) if (MSVC) @@ -83,7 +83,18 @@ elseif (ANDROID) ) # android endif() else () - set(STATIC_LIBS ...) # macos + find_package(BZIP2 REQUIRED) + set(STATIC_LIBS + "-framework Security" + ${CMAKE_SOURCE_DIR}/lib/libx264.a + ${CMAKE_SOURCE_DIR}/lib/libavcodec.a + ${CMAKE_SOURCE_DIR}/lib/libavformat.a + ${CMAKE_SOURCE_DIR}/lib/libavutil.a + ${CMAKE_SOURCE_DIR}/lib/libswresample.a + ${CMAKE_SOURCE_DIR}/lib/libswscale.a + ${BZIP2_LIBRARY} + "-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" + ) # macos endif() target_link_libraries(${PROJECT_NAME} ${STATIC_LIBS}) diff --git a/README.md b/README.md index 09f4b07..bc04d79 100644 --- a/README.md +++ b/README.md @@ -75,4 +75,23 @@ You can either run it natively on Linux or using WSL on Windows. When building for android32 you need to set android version 24, you can do so by adding this arg to your geode build command ```sh geode build --platform android32 --config Release -- -DANDROID_PLATFORM=24 +``` + +## MacOS +To get the needed libraries on MacOS, you must have pkg-config installed, have BZIP2, and build x264 from source. + +```sh +brew install pkgconfig +brew install bzip2 + +git clone https://code.videolan.org/videolan/x264.git +cd x264 +./configure --enable-static --enable-shared +make + +git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg +brew install automake fdk-aac git lame libass libtool libvorbis libvpx opus sdl shtool texi2html theora wget x264 x265 xvid nasm +mkdir output +./configure --prefix=$PWD/output --enable-static --enable-shared --enable-libx264 --enable-gpl +make ``` \ No newline at end of file