From c2f84fdccb1106bbd0ab2b640aefaf413d03871d Mon Sep 17 00:00:00 2001 From: Soren Jorvang Date: Sun, 5 Dec 2010 16:57:32 +0000 Subject: [PATCH] CLRun is now used everywhere but OS X. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6532 8ced0084-cf51-0410-be5f-012b33b47a6e --- CMakeLists.txt | 1 - Source/Core/Common/Src/OpenCL.cpp | 11 ++++++----- Source/Core/Common/Src/OpenCL.h | 5 ++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d663a2a4a9..f4aadd64d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -323,7 +323,6 @@ endif(NOT GLEW_FOUND) if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")) include_directories(Externals/CLRun/include) add_subdirectory(Externals/CLRun) - add_definitions(-DUSE_CLRUN) endif() option(DISABLE_WX "Disable wxWidgets (use CLI interface)" OFF) diff --git a/Source/Core/Common/Src/OpenCL.cpp b/Source/Core/Common/Src/OpenCL.cpp index c1a6e7166b..2b3b309794 100644 --- a/Source/Core/Common/Src/OpenCL.cpp +++ b/Source/Core/Common/Src/OpenCL.cpp @@ -21,7 +21,7 @@ #include "Common.h" #include "Timer.h" -#if defined(_WIN32) || defined(USE_CLRUN) +#ifndef __APPLE__ #include "clrun.h" #endif @@ -46,14 +46,15 @@ bool Initialize() return false; int err; // error code returned from api calls -#if defined(_WIN32) || defined(USE_CLRUN) +#ifdef __APPLE__ + // If OpenCL is weakly linked and not found, its symbols will be NULL + if (clGetPlatformIDs == NULL) + return false; +#else clrInit(); if(!clrHasOpenCL()) return false; #endif - // If OpenCL is weakly linked and not found, its symbols will be NULL - if (clGetPlatformIDs == NULL) - return false; // Connect to a compute device cl_uint numPlatforms; diff --git a/Source/Core/Common/Src/OpenCL.h b/Source/Core/Common/Src/OpenCL.h index a4ac241952..411a1697be 100644 --- a/Source/Core/Common/Src/OpenCL.h +++ b/Source/Core/Common/Src/OpenCL.h @@ -20,9 +20,8 @@ #include "Common.h" -// OpenCL on Windows is linked through the CLRun library -// It provides the headers and all the imports -#if defined(_WIN32) || defined(USE_CLRUN) +// The CLRun library provides the headers and all the imports +#ifndef __APPLE__ #define HAVE_OPENCL 1 #endif