Skip to content

Commit

Permalink
Move download yolort headers logic into prepare stage, delete yolort …
Browse files Browse the repository at this point in the history
…download script
  • Loading branch information
Psayker authored and mxlgv committed Mar 12, 2024
1 parent 9c15a81 commit ca1f97e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 23 deletions.
22 changes: 21 additions & 1 deletion build-win64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -48,7 +63,12 @@ prepare()
unzip \
curl

msg "Successfully installed!"
msg "Successfully installed!"

msg "Download YoloRT headers"
download_yolort
msg "Successfully downloaded!"

}

configure()
Expand Down
11 changes: 0 additions & 11 deletions plugins/windows-notification/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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 $<$<COMPILE_LANGUAGE:CXX>:-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/)
Expand Down
11 changes: 0 additions & 11 deletions plugins/windows-notification/prepare-yolort.sh

This file was deleted.

0 comments on commit ca1f97e

Please sign in to comment.