cmake交叉编译podofo到鸿蒙
方式1: windows命令行下脚本编译:set OHOS_SDK_HONE=D:/Huawei/Sdkset OHOS_NATIVE_HOME=D:/Huawei/Sdk/native/3.0.0.0set cmakelists_dir=D:/jhyPro/HarmonyCrossCompilation/podofo-0.9.7set bd=D:/jhyPro/HarmonyCrossCompi
·
方式1: windows命令行下脚本编译:
set OHOS_SDK_HONE=D:/Huawei/Sdk
set OHOS_NATIVE_HOME=D:/Huawei/Sdk/native/3.0.0.0
set cmakelists_dir=D:/jhyPro/HarmonyCrossCompilation/podofo-0.9.7
set bd=D:/jhyPro/HarmonyCrossCompilation/build_output/cm
set output_dir=D:/jhyPro/HarmonyCrossCompilation/build_output
set FTDIR=D:/jhyPro/HarmonyCrossCompilation/harmony_lib/include/freetype2
set LIBDIR=D:/jhyPro/HarmonyCrossCompilation/harmony_lib/lib/
set JPEGDIR=D:/jhyPro/HarmonyCrossCompilation/harmony_lib/include/jpeg
set ZLIBDIR=D:/jhyPro/HarmonyCrossCompilation/harmony_lib/include/zlib
Run the saved build.cmd from a cmd.
%OHOS_NATIVE_HOME%/build-tools/cmake/bin/cmake.exe -v -H%cmakelists_dir% -B%bd% ^
-DOHOS_ARCH=arm64-v8a -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=%output_dir% ^
-DCMAKE_BUILD_TYPE=Debug -DOHOS_SDK_NATIVE=%OHOS_NATIVE_HOME% ^
-DCMAKE_SYSTEM_NAME=OHOS -DCMAKE_OHOS_ARCH_ABI=arm64-v8a -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ^
-DCMAKE_TOOLCHAIN_FILE=%OHOS_NATIVE_HOME%/build/cmake/ohos.toolchain.cmake -G Ninja ^
-DCMAKE_MAKE_PROGRAM=%OHOS_NATIVE_HOME%/build-tools/cmake/bin/ninja.exe ^
-DCMAKE_INCLUDE_PATH="%FTDIR%;%JPEGDIR%;%ZLIBDIR%;" ^
-DCMAKE_LIBRARY_PATH="%LIBDIR%;" ^
-DPODOFO_BUILD_SHARED:BOOL=FALSE -DFREETYPE_LIBRARY_NAMES_DEBUG=freetype239MT_D ^
-DFREETYPE_LIBRARY_NAMES_RELEASE=freetype239MT
%OHOS_NATIVE_HOME%/build-tools/cmake/bin/ninja.exe -C %bd%
方式2:鸿蒙native下的cmake-gui
打开鸿蒙SDK目录下的cmake-gui:
例如:D:\Huawei\Sdk\native\3.0.0.0\build-tools\cmake\bin\cmake-gui.exe
填好这三个部分:
如果遇到下面的问题,加个变量
然后点击configure,没有弹窗的话点击generate生成,完了之后进入编译输出目录:例如:D:/jhyPro/HarmonyCrossCompilation/build_output2,执行:
D:/Huawei/Sdk/native/3.0.0.0/build-tools/cmake/bin/ninja.exe
开始编译
更多推荐
所有评论(0)