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 ...
随机推荐
- Python重要基础点
这里记录一些实际编写代码时遇到的常用/重要的内容,有前辈的,也有自己整理加进来的. 以点的形式记录,之后遇到的内容会慢慢补充进来 1. 斜杠 / :斜字第一笔, 转义用反斜杠 \ : 转的最后一笔 2 ...
- Python中各种括号的区别、用途及使用方法
python语言最常见的括号有三种,分别是:小括号( ).中括号[ ]和大括号也叫做花括号{ }.其作用也各不相同,分别用来代表不同的python基本内置数据类型. python中的小括号( ):代表 ...
- HDU 4578 - Transformation - [加强版线段树]
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4578 Problem Description Yuanfang is puzzled with the ...
- Codeforces 349C - Mafia
time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standa ...
- Pymongo NotMasterError while fetching count of the collection as per query from MongoDB in DRF
django rest framework - Pymongo NotMasterError while fetching count of the collection as per query f ...
- 【python-opencv】22-直方图
直方图目录: 22.1 直方图的计算,绘制与分析 22.1.1 统计直方图 22.1.2 绘制直方图 22.1.3 使用掩膜(遮罩) 22.2 直方图均衡化 22.2.1 OpenCV中的直方图均衡化 ...
- 【服务器】如何在服务器发布网站?Sasa讲解
一.网站发布过程 1.可以在淘宝.万维网上买服务器,然后客服提供一个服务器的远程ip链接,我们通过我们电脑的远程去链接这个远程服务器就可以对这个服务器进行控制了.. 2.将待发布网站的程序在本地保存, ...
- 定时任务,AlarmManager使用
CoderLt 定时任务,AlarmManager使用 项目需要:实现一个定时提醒的功能 查阅资料知道,需要使用AlarmManager AlarmManager介绍: AlarmManager是 ...
- Centos7 Zabbix3.2集群安装
安装环境:服务器10.80.0.191作为zabbix-server,10.80.0.191-195作为zabbix-agent. [zabbix@miyan ~]$ cat /etc/redhat- ...
- js中去除字符串两边的空格
在提交表单的时候会需要去除字符串两边的空格,代码如下: /*去除字符串两边空格*/ String.prototype.trim = function() { return this.replace(/ ...