Skip to content

Commit e119e12

Browse files
authored
X11 wayland features on linux (#1540)
* on linux, pass x11,wayland features for dylib * libprocessing on main branch
1 parent 25bca44 commit e119e12

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

buildSrc/src/main/kotlin/processing/gradle/CargoBuildTask.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package processing.gradle
33
import org.gradle.api.DefaultTask
44
import org.gradle.api.file.DirectoryProperty
55
import org.gradle.api.file.RegularFileProperty
6+
import org.gradle.api.provider.ListProperty
67
import org.gradle.api.provider.Property
78
import org.gradle.api.tasks.*
89
import 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

core/build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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") {

libprocessing

Submodule libprocessing updated 100 files

0 commit comments

Comments
 (0)