diff --git a/src/OpenColorIO/CMakeLists.txt b/src/OpenColorIO/CMakeLists.txt index 646423e97..770d706f2 100755 --- a/src/OpenColorIO/CMakeLists.txt +++ b/src/OpenColorIO/CMakeLists.txt @@ -336,7 +336,7 @@ if(OCIO_USE_SIMD AND OCIO_USE_SSE2NEON AND COMPILER_SUPPORTS_SSE_WITH_SSE2NEON) target_link_libraries(OpenColorIO PRIVATE $) endif() -if(APPLE) +if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") target_link_libraries(OpenColorIO PRIVATE "-framework ColorSync" diff --git a/src/OpenColorIO/SystemMonitor.cpp b/src/OpenColorIO/SystemMonitor.cpp index 7fcc9c366..3ce037873 100644 --- a/src/OpenColorIO/SystemMonitor.cpp +++ b/src/OpenColorIO/SystemMonitor.cpp @@ -6,6 +6,10 @@ #include #include +#if defined(__APPLE__) +#include +#endif + #include #include "Logging.h" @@ -26,7 +30,7 @@ void SystemMonitorsImpl::getAllMonitors() } // namespace OCIO_NAMESPACE -#elif __APPLE__ +#elif defined(__APPLE__) && TARGET_OS_OSX #include "SystemMonitor_macos.cpp" diff --git a/tests/cpu/CMakeLists.txt b/tests/cpu/CMakeLists.txt index 55a25588b..c71531ba2 100755 --- a/tests/cpu/CMakeLists.txt +++ b/tests/cpu/CMakeLists.txt @@ -63,7 +63,7 @@ function(add_ocio_test NAME SOURCES TESTS PRIVATE_INCLUDES) target_link_libraries(${TEST_BINARY} PRIVATE sse2neon) endif() - if(APPLE) + if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") # Frameworks needed to access the ICC monitor profile. target_link_libraries(${TEST_BINARY} PRIVATE @@ -72,7 +72,7 @@ function(add_ocio_test NAME SOURCES TESTS PRIVATE_INCLUDES) "-framework CoreGraphics" "-framework IOKit" ) - endif(APPLE) + endif() if(PRIVATE_INCLUDES) target_include_directories(${TEST_BINARY} diff --git a/tests/cpu/Config_tests.cpp b/tests/cpu/Config_tests.cpp index ed72a5e17..0ffbb42d3 100644 --- a/tests/cpu/Config_tests.cpp +++ b/tests/cpu/Config_tests.cpp @@ -4,6 +4,10 @@ #include +#if defined(__APPLE__) +#include +#endif + #include #include "Config.cpp" @@ -9845,7 +9849,8 @@ active_views: [] = std::string(OCIO::GetTestFilesDir()) + "/icc-test-1.icc"; -#if !defined(OCIO_HEADLESS_ENABLED) && ( defined(__APPLE__) || defined(_WIN32) ) +#if !defined(OCIO_HEADLESS_ENABLED) && \ + ( defined(_WIN32) || ( defined(__APPLE__) && TARGET_OS_OSX ) ) OCIO_CHECK_ASSERT(OCIO::SystemMonitors::Get()->isSupported()); @@ -10070,7 +10075,8 @@ active_views: [view] // Only the 'view' view is active. OCIO_CHECK_EQUAL(1, config->getNumViews("sRGB")); -#if !defined(OCIO_HEADLESS_ENABLED) && ( defined(__APPLE__) || defined(_WIN32) ) +#if !defined(OCIO_HEADLESS_ENABLED) && \ + ( defined(_WIN32) || ( defined(__APPLE__) && TARGET_OS_OSX ) ) OCIO_CHECK_ASSERT(OCIO::SystemMonitors::Get()->isSupported());