From ca1f97e2433eff6d8add5850d13dd72b28e9d3bd Mon Sep 17 00:00:00 2001 From: Psayker Date: Tue, 12 Mar 2024 12:09:59 +0300 Subject: [PATCH] Move download yolort headers logic into prepare stage, delete yolort download script --- build-win64.sh | 22 ++++++++++++++++++- plugins/windows-notification/CMakeLists.txt | 11 ---------- .../windows-notification/prepare-yolort.sh | 11 ---------- 3 files changed, 21 insertions(+), 23 deletions(-) delete mode 100644 plugins/windows-notification/prepare-yolort.sh diff --git a/build-win64.sh b/build-win64.sh index 49ce2c6c..3daa15f0 100644 --- a/build-win64.sh +++ b/build-win64.sh @@ -4,6 +4,21 @@ set -e DIST_DIR=${PWD}/windows-installer/win64-dist JOBS=$NUMBER_OF_PROCESSORS +download_yolort() +{ + file_name=cppwinrt-2.0.210122.3+windows-10.0.19041+yolort-835cd4e.zip + original_folder=${PWD} + + cd plugins\\windows-notification + mkdir -p yolort + cd yolort + curl -L -O https://github.com/LAGonauta/YoloRT/releases/download/v1.0.0/${file_name} + echo "675a6d943c97b4acdbfaa473f68d3241d1798b31a67b5529c8d29fc0176a1707 ${file_name}" | sha256sum --check --status + unzip -o ${file_name} + rm ${file_name} + cd ${original_folder} +} + msg() { echo -e "\e[32m$1\e[0m" @@ -48,7 +63,12 @@ prepare() unzip \ curl - msg "Successfully installed!" + msg "Successfully installed!" + + msg "Download YoloRT headers" + download_yolort + msg "Successfully downloaded!" + } configure() diff --git a/plugins/windows-notification/CMakeLists.txt b/plugins/windows-notification/CMakeLists.txt index a34d3627..fdd9a706 100644 --- a/plugins/windows-notification/CMakeLists.txt +++ b/plugins/windows-notification/CMakeLists.txt @@ -56,16 +56,6 @@ target_include_directories(windows-notification ${PROJECT_SOURCE_DIR}/yolort/include ) -add_custom_target( - yolort ALL - COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/prepare-yolort.sh - BYPRODUCTS yolort/include - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - VERBATIM - USES_TERMINAL - COMMENT "=====> Generating YoloRT Header files for Windows Notification plugin <=====" -) - find_library(shlwapi_LIBRARY shlwapi libshlwapi libshlwapi.a HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}) if(NOT shlwapi_LIBRARY) message(FATAL_ERROR "shlwapi library not found") @@ -80,7 +70,6 @@ target_link_libraries(windows-notification libdino ${shlwapi_LIBRARY} ${ntdll_LI target_compile_features(windows-notification PRIVATE cxx_std_17) target_compile_definitions(windows-notification PRIVATE WINRT_GLIB_H_INSIDE) target_compile_options(windows-notification PRIVATE $<$:-iquote ${PROJECT_SOURCE_DIR}/yolort/include/winrt/yolort_impl>) -add_dependencies(windows-notification yolort) set_target_properties(windows-notification PROPERTIES PREFIX "") set_target_properties(windows-notification PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/plugins/) diff --git a/plugins/windows-notification/prepare-yolort.sh b/plugins/windows-notification/prepare-yolort.sh deleted file mode 100644 index 5d4ac322..00000000 --- a/plugins/windows-notification/prepare-yolort.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -export FILE_NAME=cppwinrt-2.0.210122.3+windows-10.0.19041+yolort-835cd4e.zip -export ORIGINAL_FOLDER=${PWD} - -mkdir -p yolort && \ - cd yolort && \ - curl -L -O https://github.com/LAGonauta/YoloRT/releases/download/v1.0.0/${FILE_NAME} && \ - echo "675a6d943c97b4acdbfaa473f68d3241d1798b31a67b5529c8d29fc0176a1707 ${FILE_NAME}" | sha256sum --check --status && \ - unzip -o ${FILE_NAME} && \ - rm ${FILE_NAME} && \ - cd ${ORIGINAL_FOLDER}