From a5c92df1f69fa93abf9fd68ba6d2d0695d86a364 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 23 Jun 2026 08:35:16 -0700 Subject: [PATCH] [build] Enhance javacpp/setupBuild.gradle with catch2 support (#9022) --- shared/javacpp/setupBuild.gradle | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/shared/javacpp/setupBuild.gradle b/shared/javacpp/setupBuild.gradle index cf2c7a0be6..aff1a9368c 100644 --- a/shared/javacpp/setupBuild.gradle +++ b/shared/javacpp/setupBuild.gradle @@ -20,7 +20,8 @@ ext { staticGtestConfigs = [:] } -staticGtestConfigs["${nativeName}Test"] = [] +def nativeTestSuiteName = project.findProperty('nativeTestSuiteName') ?: "${nativeName}Test" +staticGtestConfigs[nativeTestSuiteName] = [] apply from: "${rootDir}/shared/googletest.gradle" apply from: "${rootDir}/shared/catch2.gradle" @@ -104,7 +105,7 @@ model { } } testSuites { - "${nativeName}Test"(GoogleTestTestSuiteSpec) { + "${nativeTestSuiteName}"(GoogleTestTestSuiteSpec) { for(NativeComponentSpec c : $.components) { if (c.name == nativeName) { testing c @@ -122,6 +123,11 @@ model { } } } + if (nativeTestSuiteName.contains('Catch2')) { + binaries.all { + lib project: ':thirdparty:catch2', library: 'catch2', linkage: 'static' + } + } } } binaries {