使用OHOS SDK构建vorbis
参照OHOS IDE和SDK的安装方法配置好开发环境。
从github下载源码。
执行如下命令:
git clone --depth=1 https://github.com/xiph/vorbis
进入源码所在的目录,创建批处理文件ohos_build.cmd
,内容如下:
@echo off
setlocal
set OHOS_SDK_HOME=D:\Tools\Huawei\OHOS\SDK\9
set CMAKE_HOME=D:\Tools\cmake-3.26.0-windows-x86_64
set PATH=%CMAKE_HOME%\bin;%PATH%
cmake --version
ninja --version
set SRC_ROOT=%CD%
set BUILD_ROOT=%SRC_ROOT%\build-ohos
cmake -G "Ninja Multi-Config" ^
-S %SRC_ROOT% ^
-B %BUILD_ROOT% ^
-DCMAKE_TOOLCHAIN_FILE=%OHOS_SDK_HOME%\native\build\cmake\ohos.toolchain.cmake ^
-DCMAKE_CXX_FLAGS="-Wno-unused-command-line-argument -ID:\workspace\CODE\ogg\include -ID:\workspace\CODE\ogg\build-ohos\include" ^
-DCMAKE_C_FLAGS="-Wno-unused-command-line-argument -ID:\workspace\CODE\ogg\include -ID:\workspace\CODE\ogg\build-ohos\include" ^
-DBUILD_SHARED_LIBS=OFF ^
-DINSTALL_CMAKE_PACKAGE_MODULE=OFF ^
-DBUILD_TESTING=OFF ^
-DOGG_LIBRARY=D:\workspace\CODE\ogg\include ^
-DOGG_INCLUDE_DIR=D:\workspace\CODE\ogg\build-ohos\Debug
cmake --build %BUILD_ROOT% --parallel
进入CMD,在源码所在的目录下,执行如下命令:
call ohos_build.cmd
等待项目编译结束。
本文来自博客园,作者:jackieathome,转载请注明原文链接:https://www.cnblogs.com/jackieathome/p/17937873