File: package.bat

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 (60 lines) | stat: -rw-r--r-- 1,304 bytes parent folder | download | duplicates (4)
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
@echo off

set halide_source=%~1
set halide_build_root=%~2
set halide_arch=%~3

if not exist "%VCPKG_ROOT%\.vcpkg-root" (
    echo Must define VCPKG_ROOT to be the root of the VCPKG install
    goto error
)

if not exist "%LLVM_DIR%\LLVMConfig.cmake" (
    echo Must set specific LLVM_DIR for packaging
    goto error
)

if not exist "%Clang_DIR%\ClangConfig.cmake" (
    echo Must set specific Clang_DIR for packaging
    goto error
)

if not exist "%LLD_DIR%\LLDConfig.cmake" (
    echo Must set specific LLD_DIR for packaging
    goto error
)

if "%halide_source%" == "" (
    echo Usage: %~0 "<source-dir>" "<build-dir>" [Win32,x64,ARM,ARM64]
    goto error
)

if "%halide_build_root%" == "" (
    echo Usage: %~0 "<source-dir>" "<build-dir>" [Win32,x64,ARM,ARM64]
    goto error
)

if "%halide_arch%" == "" (
    echo Usage: %~0 "<source-dir>" "<build-dir>" [Win32,x64,ARM,ARM64]
    goto error
)

cmake --preset=package-windows -A "%halide_arch%" -S "%halide_source%" -B "%halide_build_root%"
if ERRORLEVEL 1 goto error

REM We don't distribute Debug binaries because they aren't useful
cmake --build "%halide_build_root%" --config Release
if ERRORLEVEL 1 goto error

pushd "%halide_build_root%"
cpack -G ZIP -C "Release"
if ERRORLEVEL 1 (
    popd
    goto error
)
popd

exit /b

:error
exit /b 1