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 ...
随机推荐
- POJ-1926 Pollution
Pollution Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 4049 Accepted: 1076 Description ...
- hdu6390GuGuFishtion【数论】
GuGuFishtion Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Tot ...
- codeforces 798B - Mike and strings
感觉自己好咸鱼呀……B题写了这么久,虽然可以算作1A(忽略一次少include一个头文件的CE)…… 思想很简单,每次选定一个字符串作为目标字符串,然后把其他所有字符串都当做测试字符串,计算出总共需要 ...
- ORACLE中Drop table cascade constraints之后果.
当你要drop一个table时,如果删除table的动作会造成trigger或constraint产生矛盾,系统会出现错误警告的讯息而不会允许执行..一个极简单的例子,例如你有一个员工基本资料表,上面 ...
- is_file file_exists microtime performance
对项目中旧代码的疑问 } elseif (substr($class_name, 0, 6) == 'OAuth2') { $file_name = $C->INCPATH . 'classes ...
- LoadRunner-创建场景
录制完脚本,并调试运行正常后,想要模拟并发进行压力测试,需要创建场景. 1.点击Tools->Create Controller Scenario... 2.选择手工场景,并设置并发用户数.点击 ...
- mysql 权限管理 针对某个库 某张表 授权 tables_priv表
精确到表级别 针对db1的t3表 授予select权限 mysql> grant select on db1.t3 to 'mike'@'localhost'; Query OK, rows a ...
- python string 模块
标准库 python3 python2.7 都可以用 sting.ascii_letters是生成所有字母,从a-z和A-Z, string.digits是生成所有数字0-9. import stri ...
- SQLServer和MySQL job和 event定时器的差别
SQLServer和MySQL job和 event定时器的差别
- 【深入理解javascript】this的用法
引用:this的用法 在函数中this到底取何值,是在函数真正被调用执行的时候确定的,函数定义的时候确定不了 情况1:构造函数 函数作为构造函数用,那么其中的this就代表它即将new出来的对象.另外 ...