Skip to content

Commit

Permalink
feat: support import debug onr on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
neko-para committed Oct 10, 2023
1 parent 7edbb25 commit 59bf6f8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 67 deletions.
43 changes: 0 additions & 43 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,49 +199,6 @@ jobs:
name: MAA-linux-${{ matrix.arch }}
path: "install"

windows-debug:
needs: meta
runs-on: windows-latest
strategy:
matrix:
arch: [x86_64]
fail-fast: false

steps:
- name: Windows runner hack
shell: cmd
run: |
dir d:\a
cd ..
mkdir C:\MaaFramework
rmdir MaaFramework
mklink /j MaaFramework C:\MaaFramework
dism /Online /Disable-Feature /FeatureName:Windows-Defender /Remove /NoRestart /Quiet
cd .
- name: Windows runner hack (2)
uses: al-cheb/[email protected]
with:
minimum-size: 16GB
maximum-size: 16GB
disk-root: "D:"

- uses: actions/checkout@v3
with:
submodules: true

- name: Bootstrap MaaDeps
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python3 maadeps-download.py x64-windows
- name: Build MAA
run: |
cmake --preset "MSVC 2022" -DMAADEPS_TRIPLET="maa-x64-windows" -DMAA_HASH_VERSION='${{ needs.meta.outputs.tag }}'
cmake --build build --preset "MSVC 2022 - Debug" -j 16
macos:
needs: meta
runs-on: macos-latest
Expand Down
22 changes: 0 additions & 22 deletions cmake/modules/FindFastDeploy.cmake

This file was deleted.

13 changes: 11 additions & 2 deletions cmake/modules/FindONNXRuntime.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ find_library(ONNXRuntime_LIBRARY_IMP NAMES onnxruntime)
if (WIN32)
get_filename_component(ONNXRuntime_PATH_LIB ${ONNXRuntime_LIBRARY_IMP} DIRECTORY)
find_file(ONNXRuntime_LIBRARY NAMES onnxruntime_maa.dll PATHS "${ONNXRuntime_PATH_LIB}/../bin")

find_file(ONNXRuntime_LIBRARY_IMP_DEBUG NAMES onnxruntime.lib PATHS "${ONNXRuntime_PATH_LIB}/../debug/lib")
find_file(ONNXRuntime_LIBRARY_DEBUG NAMES onnxruntime_maa.dll PATHS "${ONNXRuntime_PATH_LIB}/../debug/bin")
else ()
set(ONNXRuntime_LIBRARY ${ONNXRuntime_LIBRARY_IMP})
endif (WIN32)
Expand All @@ -19,13 +22,19 @@ if(ONNXRuntime_FOUND)
set(ONNXRuntime_INCLUDE_DIRS ${ONNXRuntime_INCLUDE_DIR})
if(NOT TARGET ONNXRuntime::ONNXRuntime)
add_library(ONNXRuntime::ONNXRuntime SHARED IMPORTED)
set_property(TARGET ONNXRuntime::ONNXRuntime APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
if (WIN32)
set_property(TARGET ONNXRuntime::ONNXRuntime APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(ONNXRuntime::ONNXRuntime PROPERTIES
IMPORTED_IMPLIB_RELEASE "${ONNXRuntime_LIBRARY_IMP}"
)
set_target_properties(ONNXRuntime::ONNXRuntime PROPERTIES
IMPORTED_IMPLIB "${ONNXRuntime_LIBRARY_IMP}"
IMPORTED_IMPLIB_DEBUG "${ONNXRuntime_LIBRARY_IMP_DEBUG}"
IMPORTED_LOCATION_DEBUG "${ONNXRuntime_LIBRARY_DEBUG}"
)
endif (WIN32)
set_target_properties(ONNXRuntime::ONNXRuntime PROPERTIES
IMPORTED_LOCATION "${ONNXRuntime_LIBRARY}"
IMPORTED_LOCATION_RELEASE "${ONNXRuntime_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${ONNXRuntime_INCLUDE_DIR}"
)
endif()
Expand Down

0 comments on commit 59bf6f8

Please sign in to comment.