zoukankan      html  css  js  c++  java
  • 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.0 or lower.
    
    cmake_minimum_required(VERSION 3.4.1)
    
    # 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)
  • 相关阅读:
    kubectl exec 执行 容器命令
    centos下通过yum安装redis-cli
    windows下 使用ip地址反查主机名的命令
    O365(世纪互联)SharePoint 之文档库使用小记
    SharePoint 2016 图文安装教程
    SharePoint 2013 激活标题字段外的Menu菜单
    SharePoint 2013 定制搜索显示模板(二)
    SharePoint 2013 定制搜索显示模板
    SharePoint 2013 网站搜索规则的使用示例
    SharePoint 2013 搜索功能,列表项目不能完全被索引
  • 原文地址:https://www.cnblogs.com/pengmn/p/10373156.html
Copyright © 2011-2022 走看看