From 35c31c04a9805082be32474211dcd62b7629ed2b Mon Sep 17 00:00:00 2001 From: Rob Hughes Date: Mon, 17 Aug 2020 15:47:20 +0100 Subject: Fix Windows build Change-Id: I145d220c73313e31c184b6a75ab7f4823df99919 Signed-off-by: Robert Hughes --- cmake/GlobalConfig.cmake | 2 +- profiling/common/src/NetworkSockets.cpp | 8 +------- src/armnn/Logging.cpp | 2 +- src/armnn/test/UnitTests.cpp | 2 +- src/armnnUtils/Filesystem.hpp | 5 +++++ src/armnnUtils/Processes.cpp | 2 +- src/armnnUtils/Threads.cpp | 2 +- 7 files changed, 11 insertions(+), 12 deletions(-) diff --git a/cmake/GlobalConfig.cmake b/cmake/GlobalConfig.cmake index e5a586631c..b093e5d527 100644 --- a/cmake/GlobalConfig.cmake +++ b/cmake/GlobalConfig.cmake @@ -347,7 +347,7 @@ endif() # This is the root for the dynamic backend tests to search for dynamic # backends. By default it will be the project build directory. -add_definitions('-DDYNAMIC_BACKEND_BUILD_DIR="${PROJECT_BINARY_DIR}"') +add_definitions(-DDYNAMIC_BACKEND_BUILD_DIR="${PROJECT_BINARY_DIR}") # ArmNN dynamic backend if(DYNAMIC_BACKEND_PATHS) diff --git a/profiling/common/src/NetworkSockets.cpp b/profiling/common/src/NetworkSockets.cpp index 2a656552f1..15ad087d1e 100644 --- a/profiling/common/src/NetworkSockets.cpp +++ b/profiling/common/src/NetworkSockets.cpp @@ -8,17 +8,11 @@ #if defined(__unix__) || defined(__APPLE__) #include #include -#include -#endif - -#if defined(__APPLE__) || defined(_MSC_VER) || defined(__MINGW32__) -#include #endif -#if defined(__MINGW32__) #include +#include #include -#endif namespace arm { diff --git a/src/armnn/Logging.cpp b/src/armnn/Logging.cpp index 8b46a77b79..0cdcdc58ea 100644 --- a/src/armnn/Logging.cpp +++ b/src/armnn/Logging.cpp @@ -9,7 +9,7 @@ #include #if defined(_MSC_VER) -#include +#include #endif #if defined(__ANDROID__) diff --git a/src/armnn/test/UnitTests.cpp b/src/armnn/test/UnitTests.cpp index 5d9211e44f..032a49fb90 100644 --- a/src/armnn/test/UnitTests.cpp +++ b/src/armnn/test/UnitTests.cpp @@ -24,7 +24,7 @@ BOOST_GLOBAL_FIXTURE(ConfigureLoggingFixture); #include #include #include -#include +#include using namespace boost::iostreams; using namespace std; diff --git a/src/armnnUtils/Filesystem.hpp b/src/armnnUtils/Filesystem.hpp index 3d93ce610d..ba0d97a272 100644 --- a/src/armnnUtils/Filesystem.hpp +++ b/src/armnnUtils/Filesystem.hpp @@ -5,6 +5,11 @@ #pragma once +#if defined(_MSC_VER) +// ghc includes Windows.h directly, bringing in macros that we don't want (e.g. min/max). +// By including Windows.h ourselves first (with appropriate options), we prevent this. +#include +#endif #include namespace fs = ghc::filesystem; diff --git a/src/armnnUtils/Processes.cpp b/src/armnnUtils/Processes.cpp index eb68dd9dff..8b401d4145 100644 --- a/src/armnnUtils/Processes.cpp +++ b/src/armnnUtils/Processes.cpp @@ -8,7 +8,7 @@ #if defined(__unix__) || defined(__APPLE__) #include #elif defined(_MSC_VER) -#include +#include #endif namespace armnnUtils diff --git a/src/armnnUtils/Threads.cpp b/src/armnnUtils/Threads.cpp index 3ee8174d01..64a84812d2 100644 --- a/src/armnnUtils/Threads.cpp +++ b/src/armnnUtils/Threads.cpp @@ -10,7 +10,7 @@ #include #define gettid() syscall(SYS_gettid) #elif defined(_MSC_VER) -#include +#include #elif defined(__APPLE__) #include "AvailabilityMacros.h" #include -- cgit v1.2.1