File tree Expand file tree Collapse file tree
buildSrc/src/main/kotlin/processing/gradle Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package processing.gradle
33import org.gradle.api.DefaultTask
44import org.gradle.api.file.DirectoryProperty
55import org.gradle.api.file.RegularFileProperty
6+ import org.gradle.api.provider.ListProperty
67import org.gradle.api.provider.Property
78import org.gradle.api.tasks.*
89import org.gradle.process.ExecOperations
@@ -25,6 +26,9 @@ abstract class CargoBuildTask : DefaultTask() {
2526 @get:Input
2627 abstract val cargoPath: Property <String >
2728
29+ @get:Input
30+ abstract val features: ListProperty <String >
31+
2832 @get:OutputFile
2933 abstract val outputLibrary: RegularFileProperty
3034
@@ -34,6 +38,7 @@ abstract class CargoBuildTask : DefaultTask() {
3438
3539 // release by default
3640 release.convention(true )
41+ features.convention(emptyList())
3742 }
3843
3944 @TaskAction
@@ -45,9 +50,14 @@ abstract class CargoBuildTask : DefaultTask() {
4550 if (release.get()) {
4651 args.add(" --release" )
4752 }
53+ if (features.get().isNotEmpty()) {
54+ args.add(" --features" )
55+ args.add(features.get().joinToString(" ," ))
56+ }
4857 args.add(" --manifest-path" )
4958 args.add(manifestPath.get())
5059
60+
5161 execOperations.exec {
5262 workingDir = cargoWorkspaceDir.get().asFile
5363 commandLine = listOf (cargoPath.get()) + args
Original file line number Diff line number Diff line change @@ -96,6 +96,9 @@ if (enableWebGPU) {
9696 manifestPath.set(ffiManifestPath)
9797 release.set(true )
9898 cargoPath.set(PlatformUtils .getCargoPath())
99+ if (currentPlatform.os == " linux" ) {
100+ features.set(listOf (" x11" , " wayland" ))
101+ }
99102 outputLibrary.set(file(" $rustTargetDir /release/${currentPlatform.libName} " ))
100103
101104 inputs.files(fileTree(" $libprocessingDir /crates" ) {
You can’t perform that action at this time.
0 commit comments