File tree Expand file tree Collapse file tree 4 files changed +163
-116
lines changed Expand file tree Collapse file tree 4 files changed +163
-116
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ cmake_minimum_required(VERSION 3.13)
77project (onnxruntime_samples C CXX)
88if (WIN32 )
99 string (APPEND CMAKE_CXX_FLAGS " /W4" )
10+ add_compile_definitions (-DNOMINMAX)
1011else ()
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" #
4041link_directories ("${ONNXRUNTIME_ROOTDIR} /lib" )
4142
4243if (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" )
Original file line number Diff line number Diff line change 11# Copyright (c) Microsoft Corporation. All rights reserved.
22# Licensed under the MIT License.
3-
4- cmake_minimum_required (VERSION 3.13)
5-
63add_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)
78target_link_options (mnist PRIVATE "/SUBSYSTEM:WINDOWS" )
89
910copy_ort_dlls(mnist)
You can’t perform that action at this time.
0 commit comments