-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconanfile.py
More file actions
60 lines (50 loc) · 1.6 KB
/
conanfile.py
File metadata and controls
60 lines (50 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
from conan import ConanFile
from conan.tools.cmake import CMake, cmake_layout
class LuxWebgpu(ConanFile):
name = "lux-webgpu"
version = "0.1.0"
license = "BSD-3-Clause"
description = "WebGPU backend plugin for lux-accel"
package_type = "shared-library" # Plugin - always shared
settings = "os", "arch", "compiler", "build_type"
options = {
"fPIC": [True, False],
"with_dawn": [True, False],
}
default_options = {
"fPIC": True,
"with_dawn": True,
}
exports_sources = (
"CMakeLists.txt",
"include/*",
"src/*",
"test/*",
"LICENSE*",
)
# The plugin is a runtime-loaded module. It only needs backend_api.h from
# lux-accel at build time; lux-accel is NOT linked.
def build_requirements(self):
self.tool_requires("lux-accel/0.1.0")
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
def layout(self):
cmake_layout(self)
def generate(self):
# CMake auto-detects Dawn / wgpu-native via find_package / find_path.
pass
def build(self):
cmake = CMake(self)
cmake.configure(variables={
"LUX_WEBGPU_USE_DAWN": "ON" if self.options.with_dawn else "OFF",
})
cmake.build()
def package(self):
cmake = CMake(self)
cmake.install()
def package_info(self):
# Plugin - no CMake target export needed (consumers dlopen it).
self.cpp_info.libs = []
self.cpp_info.bindirs = []
self.cpp_info.libdirs = ["lib/lux/plugins"]