Skip to content

Commit

Permalink
Use presets in zip/package.bat
Browse files Browse the repository at this point in the history
  • Loading branch information
alexreinking committed May 13, 2021
1 parent 3f3ce62 commit 75a079a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
16 changes: 16 additions & 0 deletions CMakePresets.json
Expand Up @@ -85,6 +85,22 @@
"CMAKE_INSTALL_DATADIR": "share/Halide"
}
},
{
"name": "package-windows",
"inherits": "package",
"displayName": "Package ZIP for Windows",
"description": "Build for packaging Windows shared libraries.",
"binaryDir": "${sourceDir}/build",
"generator": "Visual Studio 16 2019",
"toolset": "host=x64",
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"BUILD_SHARED_LIBS": "YES",
"CMAKE_INSTALL_BINDIR": "bin/$<CONFIG>",
"CMAKE_INSTALL_LIBDIR": "lib/$<CONFIG>",
"HALIDE_INSTALL_CMAKEDIR": "lib/cmake/Halide"
}
},
{
"name": "package-unix",
"hidden": true,
Expand Down
20 changes: 1 addition & 19 deletions packaging/zip/package.bat
Expand Up @@ -39,28 +39,10 @@ if "%halide_arch%" == "" (
goto error
)

REM Ninja Multi-Config in 3.18 has some sort of bug. Very disappointing.
cmake -G "Visual Studio 16 2019" -Thost=x64 -A "%halide_arch%" ^
"-DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%/scripts/buildsystems/vcpkg.cmake" ^
"-DLLVM_DIR=%LLVM_DIR%" ^
"-DClang_DIR=%Clang_DIR%" ^
"-DLLD_DIR=%LLD_DIR%" ^
-DBUILD_SHARED_LIBS=YES ^
-DWITH_TESTS=NO ^
-DWITH_TUTORIALS=NO ^
-DWITH_DOCS=YES ^
-DWITH_UTILS=NO ^
-DWITH_PYTHON_BINDINGS=NO ^
"-DCMAKE_INSTALL_BINDIR=bin/$<CONFIG>" ^
"-DCMAKE_INSTALL_LIBDIR=lib/$<CONFIG>" ^
"-DCMAKE_INSTALL_DATADIR=share/Halide" ^
"-DHALIDE_INSTALL_CMAKEDIR=lib/cmake/Halide" ^
-S "%halide_source%" ^
-B "%halide_build_root%"
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
REM cmake --build %halide_build_root% --config Debug
cmake --build "%halide_build_root%" --config Release
if ERRORLEVEL 1 goto error

Expand Down

0 comments on commit 75a079a

Please sign in to comment.