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)
posted @ 2024-02-20 16:51  vx_guanchaoguo0  阅读(13)  评论(0编辑  收藏  举报