Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/android_build/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ org.gradle.jvmargs=-Xmx1536m
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Uncomment CXXFLAGS to set CXX flags
# Enable Common Schema 4.0 via the dedicated property (preferred):
# ./gradlew <task> -PHAVE_CS4=1 (or -PHAVE_CS4_FULL=1)
# Or pass arbitrary CXX flags via CXXFLAGS (uncomment):
# CXXFLAGS=-DHAVE_CS4=1

16 changes: 16 additions & 0 deletions lib/android_build/maesdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,22 @@ android {
if (!cxxFlag.isEmpty()) {
args.add("-DCMAKE_CXX_FLAGS=\"" + cxxFlag + "\"")
}
// Common Schema 4.0: -PHAVE_CS4=1 (or HAVE_CS4 env) maps to the
// MATSDK_HAVE_CS4 CMake option (preferred over a raw CXX flag, and
// propagated to consumers via the exported target). HAVE_CS4_FULL
// adds the server/service extensions.
String haveCs4 = project.findProperty("HAVE_CS4") ?: System.getenv("HAVE_CS4") ?: ""
String haveCs4Full = project.findProperty("HAVE_CS4_FULL") ?: System.getenv("HAVE_CS4_FULL") ?: ""
boolean cs4Full = haveCs4Full.equalsIgnoreCase("1") || haveCs4Full.equalsIgnoreCase("true") || haveCs4Full.equalsIgnoreCase("on")
// CS4_FULL implies CS4, so enable the base option too rather than
// relying on the CMake-side implication.
boolean cs4 = cs4Full || haveCs4.equalsIgnoreCase("1") || haveCs4.equalsIgnoreCase("true") || haveCs4.equalsIgnoreCase("on")
if (cs4) {
args.add("-DMATSDK_HAVE_CS4=ON")
}
if (cs4Full) {
args.add("-DMATSDK_HAVE_CS4_FULL=ON")
}
// Passes optional arguments to CMake.
arguments args.toArray(new String[args.size()])
println "cmake flag: " + arguments
Expand Down
Loading