From cfc3b9abbb71a43cd4498d4427f847c75b1d2908 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Fri, 18 Oct 2013 20:43:34 +0400 Subject: [PATCH] ocl: workaround for msvc11 bug "#error" requires DOS line endings (or fails with fatal error C1004: unexpected end-of-file found) See: http://connect.microsoft.com/VisualStudio/feedback/details/794991/c-error-directive-and-unix-line-endings-leads-to-an-unexpected-end-of-file So replace them to #pragma message. --- cmake/checks/opencl.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/cmake/checks/opencl.cpp b/cmake/checks/opencl.cpp index a46baf756..95a36f3ac 100644 --- a/cmake/checks/opencl.cpp +++ b/cmake/checks/opencl.cpp @@ -4,12 +4,21 @@ #include #endif -int main(int argc, char** argv) -{ +#ifndef _MSC_VER #ifdef CL_VERSION_1_2 #error OpenCL is valid #else #error OpenCL check failed #endif +#else +#ifdef CL_VERSION_1_2 +#pragma message ("OpenCL is valid") +#else +#pragma message ("OpenCL check failed") +#endif +#endif + +int main(int /*argc*/, char** /*argv*/) +{ return 0; }