想整理一个库的cmake工程,他用
cmake+ninja
简单了解了一下,是可以不依赖Android studio编译的cmake的,搜到了一个cmake+ninja,参考[1]
案例
参考[1]中的代码
背景
- cmake我是已经安装的了
- ninja我打算直接用Android SDK里面的
结果说ninja不对
重新安装ninja
- 下载,参考[2]
- 设置环境变量
编译通过
参考[3]的例子更加简单,然后就顺利编译过了
F:\study\compile\cmake\cmake_ninja_1\build>cmake .. -G Ninja
-- The C compiler identification is Clang 16.0.0 with GNU-like command-line
-- The CXX compiler identification is Clang 16.0.0 with GNU-like command-line
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: D:/ProgramFiles/LLVM/bin/clang.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: D:/ProgramFiles/LLVM/bin/clang++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (2.0s)
-- Generating done (0.0s)
-- Build files have been written to: F:/study/compile/cmake/cmake_ninja_1/build
参考
本站资源均来自互联网,仅供研究学习,禁止违法使用和商用,产生法律纠纷本站概不负责!如果侵犯了您的权益请与我们联系!
转载请注明出处: 免费源码网-免费的源码资源网站 » cmake+ninja交叉编译android下的静态库
发表评论 取消回复