File: FindHalide_WebGPU.cmake

package info (click to toggle)
halide 21.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 55,752 kB
  • sloc: cpp: 289,334; ansic: 22,751; python: 7,486; makefile: 4,299; sh: 2,508; java: 1,549; javascript: 282; pascal: 207; xml: 127; asm: 9
file content (27 lines) | stat: -rw-r--r-- 744 bytes parent folder | download | duplicates (3)
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
cmake_minimum_required(VERSION 3.28)

# tip: uncomment this line to get better debugging information if find_library() fails
# set(CMAKE_FIND_DEBUG_MODE TRUE)

if (EXISTS "$ENV{HL_WEBGPU_NATIVE_LIB}")
  set(Halide_WebGPU_NATIVE_LIB "$ENV{HL_WEBGPU_NATIVE_LIB}"
      CACHE FILEPATH "")
endif ()

find_library(Halide_WebGPU_NATIVE_LIB NAMES webgpu_dawn wgpu)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
  Halide_WebGPU
  REQUIRED_VARS Halide_WebGPU_NATIVE_LIB
  HANDLE_COMPONENTS
)

if (Halide_WebGPU_NATIVE_LIB AND NOT TARGET Halide::WebGPU)
  add_library(Halide::WebGPU UNKNOWN IMPORTED)
  set_target_properties(
    Halide::WebGPU
    PROPERTIES
    IMPORTED_LOCATION "${Halide_WebGPU_NATIVE_LIB}"
  )
endif ()