Skip to content

How to compile the SDK with CS 4.0 in Android in command line? #1136

@TedaLIEz

Description

@TedaLIEz

Please:

  • Describe your scenario.
  • Describe your environment: SDK version, platform, OS version, compiler type, etc.
  • Describe the focus area: transmission controls, offline storage, backend routing controls, reliability, performance, etc.
  • Add any other additional context.

I want to compile this SDK with CS 4.0 support and use it as an AAR in Android. I read through the source code and I found one marco "HAVE_CS4", I tried to compile the SDK based on v3.7.62.1 with flag -DCMAKE_CXX_FLAGS="-DHAVE_CS4=1"

maesdk/build.gradle:

if(!ext.has("build_cpp_client") || ext.build_cpp_client) {
            externalNativeBuild {
                cmake {
                    // Passes optional arguments to CMake.
                    arguments "-DCMAKE_CXX_FLAGS=\"-DHAVE_CS4=1\"", "-DANDROID_STL=c++_shared", "-DBUILD_SHARED_LIBS=1", "-DUSE_ROOM=1", "-DCMAKE_SHARED_LINKER_FLAGS=${project.findProperty("CMAKE_SHARED_LINKER_FLAGS") ?: ''}"
                }
            }
        }

However, this requires us to make changes in your gradle file, and we need to commit this change to repo to track the history. Besides, it makes it hard for us to set up this repo as a git submodule since we have to push the change to remote for submodule.

Can we enable HAVE_CS4 during the build process? For example, we can set this flag in build pipeline like: `./gradlew build -PCXX_FLAG=HAVE_CS4".

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions