android CMakeLists
https://developer.android.google.cn/studio/projects/configure-cmake
https://blog.csdn.net/songmingzhan/article/details/80720903
# Sets the minimum version of CMake required to build the native
# library. You should either keep the default value or only pass a
# value of 3.4. or lower. cmake_minimum_required(VERSION 3.4.) # Creates and names a library, sets it as either STATIC
# or SHARED, and provides the relative paths to its source code.
# You can define multiple libraries, and CMake builds it for you.
# Gradle automatically packages shared libraries with your APK. add_library(samba_client
SHARED
src/main/cpp/jni_helper/JniHelper.cc
src/main/cpp/jni_helper/JavaClassCache.cc
src/main/cpp/samba_client/SambaClient.cc
src/main/cpp/credential_cache/CredentialCache.cc
) include_directories(src/main/cpp) set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -std=c++0x -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fPIE")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pie") # Searches for a specified prebuilt library and stores the path as a
# variable. Because system libraries are included in the search path by
# default, you only need to specify the name of the public NDK library
# you want to add. CMake verifies that the library exists before
# completing its build. find_library( # Sets the name of the path variable.
log-lib # Specifies the name of the NDK library that
# you want CMake to locate.
log ) # Specifies libraries CMake should link to your target library. You
# can link multiple libraries, such as libraries you define in the
# build script, prebuilt third-party libraries, or system libraries. #set(libfolder "${CMAKE_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}")
set(libfolder "${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI}")
add_library(libsmbclient
SHARED
IMPORTED)
set_target_properties(libsmbclient
PROPERTIES IMPORTED_LOCATION
${libfolder}/libsmbclient.so) target_link_libraries(samba_client ${log-lib} libsmbclient)
android CMakeLists的更多相关文章
- Android Studio Linking an external C++ project 时候 报Invalid file name. Expected: CMakeLists.txt
Android Studio 右键Linking an external C++ project 时候 报Invalid file name. Expected: CMakeLists.txt错误 查 ...
- Android下Native的so编译:使用cmakelists.txt
android studio的CMakeLists.txt写好后,在Studio中编译没问题,在命令编译时则需要配置很多参数才能成功 示例CMakeLists.txt文件: cmake_minimum ...
- Android Studio NDK 开发 问题记录
Android NDK 开发 问题解决 编译:找不到gles3库 使用旧的编译方式,写Android.mk 进行编译.报错如下 gles3/gl3.h no such file or director ...
- Android Studio22-NDK-LLDB调试
Android Studio2.2更好的支持NDK开发,并可以像开发java一样的DEBUG程序,不需要添加gradle-experimental插件,就可调试代码! 一,下载 NDK 和构建工具 要 ...
- ubuntu14.04 + cocos2d-x-3.6 + eclipse发布android
cocos2d-x-2.2.6版本 :http://www.cnblogs.com/weishuan/p/4698470.html 接下来是3.6了 ,准备好下面四个东东,我把这些都放在XXX/App ...
- cocos2d-x 3.0rc开发指南:Windows下Android环境搭建
安装工具 1. 配置JDK JDK下载地址:http://www.oracle.com/technetwork/java/javase/downloads/index.html 本人的系统是Win7 ...
- Android -- Android下的NDK开发(一)
1,NDK是什么?为什么要进行NDK开发? NDK:Native Development Kit.Android应用运行在Dalvik虚拟机中.NDK允许开发人员使用本地代码语言(例如C和C++)实现 ...
- 实时Android语音对讲系统架构
本文属于Android局域网内的语音对讲项目系列,<通过UDP广播实现Android局域网Peer Discovering>实现了局域网内的广播及多播通信,本文将重点说明系统架构,音频信号 ...
- Android开发随手记
本文是作者在Android开发实践中的随手速记,记录一些小问题的解决方案和注意事项,持续更新. 以下是速记内容,若有不严谨的地方,望小伙伴们指出. 1.Module 不生成R文件,可尝试取消对该Mod ...
随机推荐
- HOJ 2985 Wavio Sequence(最长递增子序列以及其O(n*logn)算法)
Wavio Sequence My Tags (Edit) Source : UVA Time limit : 1 sec Memory limit : 32 M Submitted : 296, A ...
- css实现简单几何图形
前言:你知道吗?用代码就可以做出三角形.圆形.扇形等等这些几何图形呦.快过来一探究竟吧! 页面上一些简单的图形,如三角形.圆形等等,除了用图片来实现,我们还可以用css的border属性来实现,不仅减 ...
- vim编辑器的基本用法
使用linux时候,个人比较喜欢用vim编辑器,对文本进行操作. 为了方便我使用vim编辑器,特地搜索了一下教程记录于此,防止自己忘记了. 下面就是一些vim使用的基础操作: 使用vim打开软件 vi ...
- css3的一个小demo(箭头hover变化)
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- sparkuser is not in the sudoers file. This incident will be reported.
切换到root身份$su -(注意有- ,这和su是不同的,在用命令"su"的时候只是切换到root,但没有把root的环境变量传过去,还是当前用户的环境变量,用"su ...
- python就业班-淘宝-目录.txt
卷 TOSHIBA EXT 的文件夹 PATH 列表卷序列号为 AE86-8E8DF:.│ python就业班-淘宝-目录.txt│ ├─01 网络编程│ ├─01-基本概念│ │ 01-网络通信概述 ...
- android studio常用控件
1.Button设置不同的样式 <?xml version="1.0" encoding="utf-8"?> <selector xmlns: ...
- Python 列表 extend() 方法
描述 Python 列表 extend() 方法通过在列表末尾追加可迭代对象中的元素来扩展列表. 语法 extend() 方法语法: L.extend(iterable) 参数 iterable -- ...
- 编译错误 ----- /usr/bin/ld: cannot find -lc
yum install glibc-static glib-static是Gcc链接时使用到的库.
- [LeetCode] 101. Symmetric Tree_ Easy tag: BFS
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For e ...