diff --git a/openclfunctions.cpp b/openclfunctions.cpp index 0d1b06c..741b5fb 100644 --- a/openclfunctions.cpp +++ b/openclfunctions.cpp @@ -99,7 +99,7 @@ bool checkOpenCLAvailability(QString& error) else { error = "Could not find a OpenCL library"; } -#elif defined(__linux__) +#elif defined(__linux__) || defined(__APPLE__) // Try to find the OepenCL library on one of the following paths static const char* libraryPaths[] = { "libOpenCL.so", @@ -113,7 +113,9 @@ bool checkOpenCLAvailability(QString& error) "/usr/local/lib/libOpenCL.so.1", "/usr/local/lib/libpocl.so.1", "/usr/lib64/libOpenCL.so.1", - "/usr/lib32/libOpenCL.so.1" + "/usr/lib32/libOpenCL.so.1", + "/System/Library/Frameworks/OpenCL.framework", + "/System/Library/Frameworks/OpenCL.framework/Versions/A/OpenCL" }; void* libOpenCL = nullptr; for (auto libraryPath : libraryPaths) { diff --git a/openclfunctions.h b/openclfunctions.h index e422c63..f6a636d 100644 --- a/openclfunctions.h +++ b/openclfunctions.h @@ -25,7 +25,7 @@ #include #include -#if defined(__linux__) +#if defined(__linux__) || defined(__APPLE__) #include #elif defined(_WIN32) #include "windows.h" diff --git a/operatingsystem.cpp b/operatingsystem.cpp index 7152007..ea31651 100644 --- a/operatingsystem.cpp +++ b/operatingsystem.cpp @@ -20,6 +20,10 @@ #include "operatingsystem.h" +#if defined(__APPLE__) +#include "TargetConditionals.h" +#endif + OperatingSystem operatingSystem{}; void getOperatingSystem() @@ -51,7 +55,11 @@ void getOperatingSystem() operatingSystem.type = 2; #elif defined(__linux__) operatingSystem.type = 1; -#elif __APPLE__ - // @todo: dinstinguish between macos and ios +#elif defined(__APPLE__) +#if TARGET_OS_OSX + operatingSystem.type = 3; +#else + operatingSystem.type = 4; #endif -} \ No newline at end of file +#endif +}