Skip to content

Commit 38ca803

Browse files
committed
update
1 parent af1a960 commit 38ca803

File tree

14 files changed

+237
-156
lines changed

14 files changed

+237
-156
lines changed

.github/workflows/gradle-wrapper-validation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ jobs:
1010
name: "Validation"
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3
14-
- uses: gradle/wrapper-validation-action@v1
13+
- uses: actions/checkout@v5
14+
- uses: gradle/actions/wrapper-validation@v4

.github/workflows/windows.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,28 @@ jobs:
1313
Onnxruntime-SCA:
1414
runs-on: windows-2022
1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v5
1717
with:
1818
submodules: false
19-
- uses: actions/setup-python@v3
19+
- uses: actions/setup-python@v6
2020
with:
2121
python-version: '3.11.x'
2222
architecture: 'x64'
2323

24-
- uses: actions/setup-node@v3
24+
- uses: actions/setup-node@v5
2525
with:
2626
node-version: 18
2727

2828
- name: Download ORT
2929
shell: powershell
3030
run: |
31-
&${{ github.workspace }}\ci_build\download_ort_release 1.14.1
31+
&${{ github.workspace }}\ci_build\download_ort_release 1.22.1
3232
3333
- name: Config cmake
3434
run: npm i -g @microsoft/sarif-multitool && mkdir b && cd b && cmake ../c_cxx -DCMAKE_C_FLAGS="/MP /analyze:external- /external:anglebrackets /DWIN32 /D_WINDOWS /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /W4 /Ob0 /Od /RTC1 /analyze:autolog:ext .sarif" -DCMAKE_CXX_FLAGS="/EHsc /MP /analyze:external- /external:anglebrackets /DWIN32 /D_WINDOWS /DWINVER=0x0A00 /D_WIN32_WINNT=0x0A00 /DNTDDI_VERSION=0x0A000000 /W4 /Ob0 /Od /RTC1 /analyze:autolog:ext .sarif" -A x64 -T host=x64 -DONNXRUNTIME_ROOTDIR=${{ github.workspace }}\onnxruntimebin && cmake --build . --config Debug && npx @microsoft/sarif-multitool merge *.sarif --recurse --output-directory=${{ github.workspace }}\output --output-file=MergeResult.sarif --merge-runs
3535

3636
- name: Upload SARIF to GitHub
37-
uses: github/codeql-action/upload-sarif@v2
37+
uses: github/codeql-action/upload-sarif@v3
3838
continue-on-error: true
3939
with:
4040
sarif_file: ${{ github.workspace }}\output\MergeResult.sarif

c_cxx/CMakeLists.txt

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ cmake_minimum_required(VERSION 3.13)
77
project(onnxruntime_samples C CXX)
88
if (WIN32)
99
string(APPEND CMAKE_CXX_FLAGS " /W4")
10+
add_compile_definitions(-DNOMINMAX)
1011
else()
1112
string(APPEND CMAKE_CXX_FLAGS " -Wall -Wextra")
1213
string(APPEND CMAKE_C_FLAGS " -Wall -Wextra")
@@ -19,7 +20,7 @@ option(LIBPNG_ROOTDIR "libpng root dir")
1920
option(ONNXRUNTIME_ROOTDIR "onnxruntime root dir")
2021
include(FetchContent)
2122

22-
set(CMAKE_CXX_STANDARD 17)
23+
set(CMAKE_CXX_STANDARD 20)
2324

2425
if(NOT ONNXRUNTIME_ROOTDIR)
2526
if(WIN32)
@@ -40,15 +41,15 @@ include_directories("${ONNXRUNTIME_ROOTDIR}/include" #
4041
link_directories("${ONNXRUNTIME_ROOTDIR}/lib")
4142

4243
if(WIN32)
43-
add_library(wil INTERFACE)
44-
44+
set(WIL_BUILD_PACKAGING OFF CACHE BOOL "" FORCE)
45+
set(WIL_BUILD_TESTS OFF CACHE BOOL "" FORCE)
4546
FetchContent_Declare(
4647
microsoft_wil
47-
URL https://github.com/microsoft/wil/archive/refs/tags/v1.0.220914.1.zip
48+
URL https://github.com/microsoft/wil/archive/refs/tags/v1.0.250325.1.zip
49+
EXCLUDE_FROM_ALL
4850
)
49-
FetchContent_Populate(microsoft_wil)
50-
target_include_directories(wil INTERFACE ${microsoft_wil_SOURCE_DIR}/include)
51-
set(WIL_LIB wil)
51+
FetchContent_MakeAvailable(microsoft_wil)
52+
set(WIL_LIB "WIL::WIL")
5253
endif()
5354

5455
# On Linux the samples use libjpeg and libpng for decoding images.
@@ -97,4 +98,4 @@ add_subdirectory(squeezenet)
9798
if(WIN32 OR PNG_FOUND)
9899
add_subdirectory(fns_candy_style_transfer)
99100
endif()
100-
add_subdirectory(model-explorer)
101+
add_subdirectory(model-explorer)

c_cxx/MNIST/CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
3-
4-
cmake_minimum_required(VERSION 3.13)
5-
63
add_executable(mnist MNIST.cpp)
4+
if(WIN32)
5+
target_compile_definitions(mnist PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)
6+
endif()
7+
target_link_libraries(mnist PRIVATE WIL::WIL)
78
target_link_options(mnist PRIVATE "/SUBSYSTEM:WINDOWS")
89

910
copy_ort_dlls(mnist)

0 commit comments

Comments
 (0)