Skip to content

Commit 69e23b2

Browse files
committed
update
1 parent 51b1858 commit 69e23b2

File tree

4 files changed

+163
-116
lines changed

4 files changed

+163
-116
lines changed

c_cxx/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
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")
@@ -40,12 +41,12 @@ include_directories("${ONNXRUNTIME_ROOTDIR}/include" #
4041
link_directories("${ONNXRUNTIME_ROOTDIR}/lib")
4142

4243
if(WIN32)
43-
add_library(wil INTERFACE)
4444
set(WIL_BUILD_PACKAGING OFF CACHE BOOL "" FORCE)
4545
set(WIL_BUILD_TESTS OFF CACHE BOOL "" FORCE)
4646
FetchContent_Declare(
4747
microsoft_wil
4848
URL https://github.com/microsoft/wil/archive/refs/tags/v1.0.250325.1.zip
49+
EXCLUDE_FROM_ALL
4950
)
5051
FetchContent_MakeAvailable(microsoft_wil)
5152
set(WIL_LIB "WIL::WIL")

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)