diff --git a/cub/cmake/header_test.in b/cub/cmake/header_test.in index 4a6b507ce72..e50c285bace 100644 --- a/cub/cmake/header_test.in +++ b/cub/cmake/header_test.in @@ -46,6 +46,11 @@ //#define min(...) CUB_MACRO_CHECK('min', windows.h) //#define max(...) CUB_MACRO_CHECK('max', windows.h) +#ifdef _WIN32 +// On Windows, make sure any include of Windows.h (e.g. via NVTX) does not define the checked macros +# define WIN32_LEAN_AND_MEAN +#endif // _WIN32 + // termios.h conflicts (NVIDIA/thrust#1547) #define B0 CUB_MACRO_CHECK("B0", termios.h) diff --git a/thrust/cmake/header_test.in b/thrust/cmake/header_test.in index 250dd5170b3..59e44e03c15 100644 --- a/thrust/cmake/header_test.in +++ b/thrust/cmake/header_test.in @@ -53,6 +53,11 @@ //#define min(...) THRUST_MACRO_CHECK('min', windows.h) //#define max(...) THRUST_MACRO_CHECK('max', windows.h) +#ifdef _WIN32 +// On Windows, make sure any include of Windows.h (e.g. via NVTX) does not define the checked macros +# define WIN32_LEAN_AND_MEAN +#endif // _WIN32 + // termios.h conflicts (NVIDIA/thrust#1547) #define B0 THRUST_MACRO_CHECK("B0", termios.h)