Add wgpu to windows packaging

This commit is contained in:
Nikita Lisitsa 2024-06-18 12:35:39 +03:00
parent 7218730e7c
commit bd202d08ae
4 changed files with 27 additions and 1 deletions

View file

@ -3,7 +3,7 @@ if(wgpu-native_FOUND)
endif() endif()
# Don't search for include files - these are bundled with psemek-wgpu lib # Don't search for include files - these are bundled with psemek-wgpu lib
find_library(wgpu-native_LIBRARIES NAMES libwgpu_native.a wgpu_native PATHS "${WGPU_NATIVE_ROOT}") find_library(wgpu-native_LIBRARIES NAMES libwgpu_native.a wgpu_native.dll wgpu_native PATHS "${WGPU_NATIVE_ROOT}")
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(wgpu-native DEFAULT_MSG wgpu-native_LIBRARIES) find_package_handle_standard_args(wgpu-native DEFAULT_MSG wgpu-native_LIBRARIES)

View file

@ -69,6 +69,23 @@ RUN mv blender-3.2.0-linux-x64 blender
RUN rm blender-3.2.0-linux-x64.tar.xz RUN rm blender-3.2.0-linux-x64.tar.xz
RUN ln -sv /home/blender/blender /usr/local/bin/blender RUN ln -sv /home/blender/blender /usr/local/bin/blender
# Install wgpu-native for host
RUN wget https://github.com/gfx-rs/wgpu-native/releases/download/v0.19.4.1/wgpu-linux-x86_64-release.zip
RUN mkdir -p wgpu-native
RUN unzip wgpu-*.zip -d wgpu-native
RUN rm wgpu-*.zip
RUN mkdir -p wgpu-native/install/host
RUN mv wgpu-native/libwgpu_native.a wgpu-native/install/host
# Install wgpu-native for target
RUN wget https://github.com/gfx-rs/wgpu-native/releases/download/v0.19.4.1/wgpu-windows-x86_64-release.zip
RUN mkdir -p wgpu-native
RUN unzip -o wgpu-*.zip -d wgpu-native
RUN rm wgpu-*.zip
RUN chmod +x wgpu-native/wgpu_native.dll
RUN mkdir -p wgpu-native/install/target
RUN mv wgpu-native/wgpu_native.dll.lib wgpu-native/wgpu_native.dll wgpu-native/install/target
# Install toolchain files & main packaging script # Install toolchain files & main packaging script
COPY toolchain-host.cmake . COPY toolchain-host.cmake .
COPY toolchain-target.cmake . COPY toolchain-target.cmake .

View file

@ -9,3 +9,7 @@ set(PSEMEK_PACKAGE_TARGET OFF)
set(PSEMEK_PACKAGE_TOOLS_PATH "${PSEMEK_PACKAGE_ROOT}/tools") set(PSEMEK_PACKAGE_TOOLS_PATH "${PSEMEK_PACKAGE_ROOT}/tools")
list(APPEND CMAKE_PREFIX_PATH "${PSEMEK_PACKAGE_ROOT}/sdl2/install") list(APPEND CMAKE_PREFIX_PATH "${PSEMEK_PACKAGE_ROOT}/sdl2/install")
set(WGPU_NATIVE_ROOT
"${PSEMEK_PACKAGE_ROOT}/wgpu-native/install/host"
)

View file

@ -14,9 +14,14 @@ set(PSEMEK_PACKAGE_TOOLS_PATH "${PSEMEK_PACKAGE_ROOT}/tools")
set(PSEMEK_PACKAGE_COPY_FILES set(PSEMEK_PACKAGE_COPY_FILES
${PSEMEK_PACKAGE_ROOT}/sdl2/install/bin/SDL2.dll ${PSEMEK_PACKAGE_ROOT}/sdl2/install/bin/SDL2.dll
/usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll
${PSEMEK_PACKAGE_ROOT}/wgpu-native/install/target/wgpu_native.dll
) )
list(APPEND CMAKE_PREFIX_PATH list(APPEND CMAKE_PREFIX_PATH
"${PSEMEK_PACKAGE_ROOT}/sdl2/install" "${PSEMEK_PACKAGE_ROOT}/sdl2/install"
"${PSEMEK_PACKAGE_ROOT}/boost/install" "${PSEMEK_PACKAGE_ROOT}/boost/install"
) )
set(WGPU_NATIVE_ROOT
"${PSEMEK_PACKAGE_ROOT}/wgpu-native/install/target"
)