Build YoloRT on project build
This commit is contained in:
parent
97753bd5c4
commit
88a376c1c2
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -2,3 +2,6 @@
|
||||||
path = plugins/signal-protocol/libsignal-protocol-c
|
path = plugins/signal-protocol/libsignal-protocol-c
|
||||||
url = https://github.com/WhisperSystems/libsignal-protocol-c.git
|
url = https://github.com/WhisperSystems/libsignal-protocol-c.git
|
||||||
branch = v2.3.3
|
branch = v2.3.3
|
||||||
|
[submodule "plugins/windows-notification/yolort-builder"]
|
||||||
|
path = plugins/windows-notification/yolort-builder
|
||||||
|
url = https://github.com/Yuubi-san/YoloRT.git
|
||||||
|
|
1
plugins/windows-notification/.gitignore
vendored
Normal file
1
plugins/windows-notification/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
/yolort
|
|
@ -56,6 +56,16 @@ target_include_directories(windows-notification
|
||||||
${PROJECT_SOURCE_DIR}/yolort/include
|
${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})
|
find_library(shlwapi_LIBRARY shlwapi libshlwapi libshlwapi.a HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
|
||||||
if(NOT shlwapi_LIBRARY)
|
if(NOT shlwapi_LIBRARY)
|
||||||
message(FATAL_ERROR "shlwapi library not found")
|
message(FATAL_ERROR "shlwapi library not found")
|
||||||
|
@ -66,15 +76,11 @@ if(NOT ntdll_LIBRARY)
|
||||||
message(FATAL_ERROR "ntdll library not found")
|
message(FATAL_ERROR "ntdll library not found")
|
||||||
endif(NOT ntdll_LIBRARY)
|
endif(NOT ntdll_LIBRARY)
|
||||||
|
|
||||||
find_library(mincore_LIBRARY mincore libmincore libmincore.a HINTS ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
|
target_link_libraries(windows-notification libdino ${shlwapi_LIBRARY} ${ntdll_LIBRARY} ${WINDOWS_NOTIFICATION_PACKAGES})
|
||||||
if(NOT mincore_LIBRARY)
|
|
||||||
message(FATAL_ERROR "mincore library not found")
|
|
||||||
endif(NOT mincore_LIBRARY)
|
|
||||||
|
|
||||||
target_link_libraries(windows-notification libdino ${shlwapi_LIBRARY} ${propsys_LIBRARY} ${ntdll_LIBRARY} ${mincore_LIBRARY} ${WINDOWS_NOTIFICATION_PACKAGES})
|
|
||||||
target_compile_features(windows-notification PRIVATE cxx_std_20)
|
target_compile_features(windows-notification PRIVATE cxx_std_20)
|
||||||
target_compile_definitions(windows-notification PRIVATE WINRT_GLIB_H_INSIDE)
|
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>)
|
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 PREFIX "")
|
||||||
set_target_properties(windows-notification PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/plugins/)
|
set_target_properties(windows-notification PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/plugins/)
|
||||||
|
|
15
plugins/windows-notification/prepare-yolort.sh
Normal file
15
plugins/windows-notification/prepare-yolort.sh
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
export ORIGINAL_FOLDER=${PWD}
|
||||||
|
cd ${PWD}/yolort-builder
|
||||||
|
|
||||||
|
if [ ! -f bin/cppwinrt.exe ]; then
|
||||||
|
make CPPWINRT_VERSION=2.0.210122.3 bin/cppwinrt.exe
|
||||||
|
fi
|
||||||
|
|
||||||
|
make originals
|
||||||
|
make --jobs=$(nproc)
|
||||||
|
|
||||||
|
mkdir -p ../yolort
|
||||||
|
cp -r include ../yolort
|
||||||
|
cd ${ORIGINAL_FOLDER}
|
1
plugins/windows-notification/yolort-builder
Submodule
1
plugins/windows-notification/yolort-builder
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 835cd4eefd456df0a9d017310beba772f1c48460
|
Loading…
Reference in a new issue