From 399f2b1c0f4dd8e5b06390498e83caffd13994a1 Mon Sep 17 00:00:00 2001 From: Diego Sanchez Date: Mon, 8 Jun 2020 05:17:00 -0700 Subject: [PATCH] Fixes build with cocoapods Summary: We're not able to find webp headers unless we use use the libwebp module name! Seems the same as https://github.com/facebookincubator/spectrum/issues/187 I just updated cocoapods so likely broke in some version. Reviewed By: wizh Differential Revision: D21908724 fbshipit-source-id: 80191464ea3159ac69df4fb93e362e672a2e5ccd --- SpectrumCore.podspec | 1 + cpp/spectrum/plugins/webp/LibWebpCompressor.h | 4 ++++ cpp/spectrum/plugins/webp/LibWebpDecompressor.cpp | 4 ++++ cpp/spectrum/plugins/webp/LibWebpDecompressor.h | 4 ++++ ios/SpectrumKitSample/Podfile.lock | 2 +- 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/SpectrumCore.podspec b/SpectrumCore.podspec index fc81ec96..2e55acf1 100644 --- a/SpectrumCore.podspec +++ b/SpectrumCore.podspec @@ -54,6 +54,7 @@ Spectrum is a cross-platform image transcoding library that can easily be integr plugins_webp_spec.source_files = 'cpp/spectrum/plugins/webp/**/*.{h,cpp}' plugins_webp_spec.header_dir = 'spectrum/plugins/webp' plugins_webp_spec.header_mappings_dir = 'cpp/spectrum/plugins/webp' + plugins_webp_spec.compiler_flags = "-DCOCOAPODS_BUILD" end end end diff --git a/cpp/spectrum/plugins/webp/LibWebpCompressor.h b/cpp/spectrum/plugins/webp/LibWebpCompressor.h index 61c0b120..0af5da82 100644 --- a/cpp/spectrum/plugins/webp/LibWebpCompressor.h +++ b/cpp/spectrum/plugins/webp/LibWebpCompressor.h @@ -12,7 +12,11 @@ #include +#ifdef COCOAPODS_BUILD +#include +#else #include +#endif #include #include diff --git a/cpp/spectrum/plugins/webp/LibWebpDecompressor.cpp b/cpp/spectrum/plugins/webp/LibWebpDecompressor.cpp index d542132b..82a0f1e1 100644 --- a/cpp/spectrum/plugins/webp/LibWebpDecompressor.cpp +++ b/cpp/spectrum/plugins/webp/LibWebpDecompressor.cpp @@ -11,7 +11,11 @@ #include #include +#ifdef COCOAPODS_BUILD +#include +#else #include "webp/decode.h" +#endif #include diff --git a/cpp/spectrum/plugins/webp/LibWebpDecompressor.h b/cpp/spectrum/plugins/webp/LibWebpDecompressor.h index 8d138452..bbb45a96 100644 --- a/cpp/spectrum/plugins/webp/LibWebpDecompressor.h +++ b/cpp/spectrum/plugins/webp/LibWebpDecompressor.h @@ -11,7 +11,11 @@ #include #include +#ifdef COCOAPODS_BUILD +#include +#else #include +#endif #include diff --git a/ios/SpectrumKitSample/Podfile.lock b/ios/SpectrumKitSample/Podfile.lock index ca9eb896..1ed22ac8 100644 --- a/ios/SpectrumKitSample/Podfile.lock +++ b/ios/SpectrumKitSample/Podfile.lock @@ -76,7 +76,7 @@ SPEC CHECKSUMS: libwebp: 946cb3063cea9236285f7e9a8505d806d30e07f3 mozjpeg: bbe5f12952c272e10063446feaf7ec09a800c5e3 spectrum-folly: 7a893fae801f809e710d4d5a8325034131e0e949 - SpectrumCore: b6e3215eecf37f5a34a513149d254cbcb591aea2 + SpectrumCore: e4d7e7baa857185184ce8d7f6d5f850ecbd81cfc SpectrumKit: ab258a700c3a5fd0559fba8b55db24a733eb954e PODFILE CHECKSUM: a3355323527bc38784cfac19efa6537f855b6fa9