From 2849dc6a2adf1cff016b3cf73a57fcac1eaf3787 Mon Sep 17 00:00:00 2001 From: Philip Rideout Date: Wed, 21 Oct 2020 18:38:52 -0700 Subject: [PATCH] Fix iOS build break. --- filament/backend/CMakeLists.txt | 9 +++++---- filament/backend/test/test_ReadPixels.cpp | 12 ++++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/filament/backend/CMakeLists.txt b/filament/backend/CMakeLists.txt index a4fd099661..8221845337 100644 --- a/filament/backend/CMakeLists.txt +++ b/filament/backend/CMakeLists.txt @@ -307,8 +307,6 @@ if (APPLE) filabridge getopt gtest - image - imageio SPIRV spirv-cross-glsl) @@ -323,13 +321,16 @@ if (APPLE) getopt gtest glslang - image - imageio spirv-cross-core spirv-cross-glsl spirv-cross-msl ) + if (NOT IOS) + target_link_libraries(backend_test PRIVATE image imageio) + list(APPEND BACKEND_TEST_DEPS image imageio) + endif() + set(BACKEND_TEST_COMBINED_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libbackendtest_combined.a") combine_static_libs(backend_test "${BACKEND_TEST_COMBINED_OUTPUT}" "${BACKEND_TEST_DEPS}") diff --git a/filament/backend/test/test_ReadPixels.cpp b/filament/backend/test/test_ReadPixels.cpp index cdf9a38a52..59b947b924 100644 --- a/filament/backend/test/test_ReadPixels.cpp +++ b/filament/backend/test/test_ReadPixels.cpp @@ -16,10 +16,6 @@ #include "BackendTest.h" -#include - -#include - #include "ShaderGenerator.h" #include "TrianglePrimitive.h" @@ -29,7 +25,13 @@ using namespace filament; using namespace filament::backend; + +#ifndef IOS +#include +#include + using namespace image; +#endif namespace { @@ -123,6 +125,7 @@ TEST_F(BackendTest, ReadPixels) { } void exportScreenshot(void* pixelData) const { + #ifndef IOS const size_t width = readRect.width, height = readRect.height; LinearImage image(width, height, 4); if (format == PixelDataFormat::RGBA && type == PixelDataType::UBYTE) { @@ -135,6 +138,7 @@ TEST_F(BackendTest, ReadPixels) { std::ofstream outputStream(png.c_str(), std::ios::binary | std::ios::trunc); ImageEncoder::encode(outputStream, ImageEncoder::Format::PNG, image, "", png.c_str()); + #endif } PixelDataFormat format = PixelDataFormat::RGBA;