Git Product home page Git Product logo

memcache's Introduction

集成

构建Android库

  1. 将项目通过gradle集成到项目中

  2. 在项目build.gradle中添加prefab的支持

    android {
    	...
      buildFeatures {
            prefab true
      }
      ...
    }
  3. 在项目中创建一个cpp文件夹,写一个CMakeLists.txt

    # For more information about using CMake with Android Studio, read the
    # documentation: https://d.android.com/studio/projects/add-native-code.html
    
    # Sets the minimum version of CMake required to build the native library.
    
    cmake_minimum_required(VERSION 3.22.1)
    
    # Declares and names the project.
    
    project(YourProject VERSION 1.0.0 LANGUAGES CXX)
    
    find_package(MemCache REQUIRED CONFIG)
    
    add_library(
            YourProject
            SHARED
            native-lib.cpp)
    
    find_library(
            log-lib
            log)
    
    target_link_libraries(
            YourProject
            MemCache::MemCache
            ${log-lib})
  4. 在配置中添加cpp的编译配置

    android {
      	...
        defaultConfig {
           ...
           externalNativeBuild {
                cmake {
                    cppFlags "-O2 -frtti -fexceptions -Wall -fstack-protector-all -std=c++20 -DONANDROID"
                    abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
                    arguments '-DANDROID_STL=c++_shared'
              }
          }
          ...
      }
      buildFeatures {
            prefab true
      }
      
       externalNativeBuild {
            cmake {
                path "src/main/cpp/CMakeLists.txt"
                version '3.22.1'
            }
        }
      ...
    }

构建iOS库

  1. 在此项目目录执行
./build_ios.sh
  1. 通过cocoapods集成(通过路径或者git地址)
pod 'MemCache-Swift', :path => "../../cpp/MemCache"

memcache's People

Contributors

panicfrog avatar panicfrog-docs avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.