x264 静态编译
下载
git clone https://code.videolan.org/videolan/x264.git
编译
./configure --host=aarch64-apple-darwin --prefix=/opt/local --enable-shared --enable-static --disable-asm
安装
sudo make -j32 && sudo make install
添加静态库
cmake_minimum_required(VERSION 3.28)
project(x264_encoder C)
set(CMAKE_C_STANDARD 99)
add_executable(x264_encoder main.c)
add_library(x264 STATIC IMPORTED)
set_property(TARGET x264 PROPERTY IMPORTED_LOCATION /opt/local/lib/libx264.a)
target_link_libraries(${PROJECT_NAME} x264)
include_directories(/opt/local/include)
本文来自博客园,作者:vx_guanchaoguo0,转载请注明原文链接:https://www.cnblogs.com/guanchaoguo/p/18023507