<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>130195</bug_id>
          
          <creation_ts>2014-03-13 08:23:32 -0700</creation_ts>
          <short_desc>[CMake] Failure to link with older installations of WebP</short_desc>
          <delta_ts>2014-03-14 03:09:48 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mario Sanchez Prada">mario</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bunhere</cc>
    
    <cc>commit-queue</cc>
    
    <cc>gustavo</cc>
    
    <cc>gyuyoung.kim</cc>
    
    <cc>mathstuf</cc>
    
    <cc>ossy</cc>
    
    <cc>rakuco</cc>
    
    <cc>sergio</cc>
    
    <cc>webkit-ews</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>990010</commentid>
    <comment_count>0</comment_count>
    <who name="Mario Sanchez Prada">mario</who>
    <bug_when>2014-03-13 08:23:32 -0700</bug_when>
    <thetext>I hit the following problem today while trying to build WebKitGTK+ in my Ubuntu 12.10 box, which comes with libwebp 0.1.3-3 installed:

[4676/5658] Linking CXX shared library lib/libwebkitgtk-3.0.so.0.22.0
FAILED: : &amp;&amp; /usr/lib/ccache/c++  -fPIC  -std=gnu++0x -fno-omit-frame-pointer -fno-tree-dce -O3 -DNDEBUG  -Wl,--no-undefined  -L/home/SERILOCAL/mario.prada/work/WebKit/WebKitBuild/Dependencies/Root/lib64 -shared -Wl,-soname,libwebkitgtk-3.0.so.0 -o lib/libwebkitgtk-3.0.so.0.22.0 @CMakeFiles/WebKit.rsp  &amp;&amp; :
lib/libWebCoreGTK.a(lib/../Source/WebCore/CMakeFiles/WebCore.dir/platform/image-decoders/webp/WEBPImageDecoder.cpp.o):WEBPImageDecoder.cpp:function WebCore::WEBPImageDecoder::clear(): error: undefined reference to &apos;WebPIDelete&apos;
lib/libWebCoreGTK.a(lib/../Source/WebCore/CMakeFiles/WebCore.dir/platform/image-decoders/webp/WEBPImageDecoder.cpp.o):WEBPImageDecoder.cpp:function WebCore::WEBPImageDecoder::decode(bool): error: undefined reference to &apos;WebPIUpdate&apos;
lib/libWebCoreGTK.a(lib/../Source/WebCore/CMakeFiles/WebCore.dir/platform/image-decoders/webp/WEBPImageDecoder.cpp.o):WEBPImageDecoder.cpp:function WebCore::WEBPImageDecoder::decode(bool): error: undefined reference to &apos;WebPGetInfo&apos;
lib/libWebCoreGTK.a(lib/../Source/WebCore/CMakeFiles/WebCore.dir/platform/image-decoders/webp/WEBPImageDecoder.cpp.o):WEBPImageDecoder.cpp:function WebCore::WEBPImageDecoder::decode(bool): error: undefined reference to &apos;WebPINewRGB&apos;
collect2: error: ld returned 1 exit status


Apparently, the check_include_files() in FindWebP.cmake file is not working as expected, since WEBP_FOUND is always defined to FALSE after calling it, no matter what you put as the header file to check (it even fails when searching for &quot;stdio.h&quot;). This is causing that the -lwebp flag is not being added, thus causing the trouble</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>990011</commentid>
    <comment_count>1</comment_count>
      <attachid>226595</attachid>
    <who name="Mario Sanchez Prada">mario</who>
    <bug_when>2014-03-13 08:27:57 -0700</bug_when>
    <thetext>Created attachment 226595
Patch proposal

Please review, thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>990015</commentid>
    <comment_count>2</comment_count>
    <who name="Mario Sanchez Prada">mario</who>
    <bug_when>2014-03-13 08:51:40 -0700</bug_when>
    <thetext>Thanks for the review, Gustavo. Still, I&apos;m now adding Ben to CC, as per Martin&apos;s suggestion, to get extra feedback before landing the patch (no pun intended, Gustavo! :))</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>990036</commentid>
    <comment_count>3</comment_count>
    <who name="Ben Boeckel">mathstuf</who>
    <bug_when>2014-03-13 09:40:50 -0700</bug_when>
    <thetext>Looks good to me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>990047</commentid>
    <comment_count>4</comment_count>
      <attachid>226595</attachid>
    <who name="Mario Sanchez Prada">mario</who>
    <bug_when>2014-03-13 10:06:46 -0700</bug_when>
    <thetext>Comment on attachment 226595
Patch proposal

(In reply to comment #3)
&gt; Looks good to me.

Thanks Ben, now setting the cq+ flag then.

Btw, any theory on why this is needed? As per discussion on IRC, it seems it could be related to CMake&apos;s cache, that might not get updated while calling check_include_files(), thus the need of explicitly calling set(). Does that make sense?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>990068</commentid>
    <comment_count>5</comment_count>
    <who name="Ben Boeckel">mathstuf</who>
    <bug_when>2014-03-13 11:01:11 -0700</bug_when>
    <thetext>Following check_include_files down, it turns into a try_compile which stores its result using the cache. It is using the type INTERNAL though, so it should just overwrite whatever was there before. Has there been testing to show WEBP_FOUND before and after the check_include_files versus WEBP_FOUND_HEADER?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>990234</commentid>
    <comment_count>6</comment_count>
      <attachid>226595</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2014-03-13 18:52:13 -0700</bug_when>
    <thetext>Comment on attachment 226595
Patch proposal

Clearing flags on attachment: 226595

Committed r165588: &lt;http://trac.webkit.org/changeset/165588&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>990235</commentid>
    <comment_count>7</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2014-03-13 18:52:18 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>990373</commentid>
    <comment_count>8</comment_count>
    <who name="Mario Sanchez Prada">mario</who>
    <bug_when>2014-03-14 02:58:18 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; Following check_include_files down, it turns into a try_compile which stores its result using the cache. It is using the type INTERNAL though, so it should just overwrite whatever was there before. Has there been testing to show WEBP_FOUND before and after the check_include_files versus WEBP_FOUND_HEADER?

Yes, I&apos;ve tried exactly that and in my lousy experiments (using message()) I observed that WEBP_FOUND was always FALSE before and after calling check_include_files(), even when looking for things such as &quot;stdio.h&quot; or getopts.h&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>990374</commentid>
    <comment_count>9</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2014-03-14 03:09:48 -0700</bug_when>
    <thetext>I ran into the same bug and I can confirm that the committed fix is the
proper fix.

The root of the problem is the implementation of check_include_files

MACRO(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
  IF(&quot;${VARIABLE}&quot; MATCHES &quot;^${VARIABLE}$&quot;) -----------&gt; BANG !!!!!!!
....
  ENDIF(&quot;${VARIABLE}&quot; MATCHES &quot;^${VARIABLE}$&quot;)
ENDMACRO(CHECK_INCLUDE_FILES)


It is true if and only if the actual VARIABLE argument is undefined,
but &quot;pkg_check_modules(WEBP libwebp)&quot; in Source/cmake/FindWebP.cmake
set WEBP_FOUND to empty string. I confirmed it on a small example.
(But this kind of check only works inside macros. Otherwise it is always
true for undefined variable, empty string, non-empty string too.)</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>226595</attachid>
            <date>2014-03-13 08:27:57 -0700</date>
            <delta_ts>2014-03-13 18:52:12 -0700</delta_ts>
            <desc>Patch proposal</desc>
            <filename>0001-2014-03-13-Mario-Sanchez-Prada-mario.prada-samsung.c.patch</filename>
            <type>text/plain</type>
            <size>2557</size>
            <attacher name="Mario Sanchez Prada">mario</attacher>
            
              <data encoding="base64">RnJvbSA1ZGQxZTkwNDNlYmQxMGJmNDg2M2Q4MWQzMDkzYTM1N2RhYmI2ZmM0IE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBNYXJpbyBTYW5jaGV6IFByYWRhIDxtYXJpby5wcmFkYUBzYW1z
dW5nLmNvbT4KRGF0ZTogVGh1LCAxMyBNYXIgMjAxNCAxNToyNTo1OCArMDAwMApTdWJqZWN0OiBb
UEFUQ0hdIDIwMTQtMDMtMTMgIE1hcmlvIFNhbmNoZXogUHJhZGEgIDxtYXJpby5wcmFkYUBzYW1z
dW5nLmNvbT4KCiAgICAgICAgW0NNYWtlXSBGYWlsdXJlIHRvIGxpbmsgd2l0aCBvbGRlciBpbnN0
YWxsYXRpb25zIG9mIFdlYlAKICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1
Zy5jZ2k/aWQ9MTMwMTk1CgogICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgoKICAg
ICAgICBGaXggdGhlIGlzc3VlIGJ5IHVzaW5nIGEgdGVtcG9yYXJ5IHZhcmlhYmxlIGFzIHRoZSBv
dXRwdXQgcGFyYW1ldGVyCiAgICAgICAgdG8gY2hlY2tfaW5jbHVkZV9maWxlcygpLCBzZXR0aW5n
IFdFQlBfRk9VTkQgYWNjb3JkaW5nbHkgbGF0ZXIuCgogICAgICAgICogU291cmNlL2NtYWtlL0Zp
bmRXZWJQLmNtYWtlOiBBdm9pZCByZXVzaW5nIHRoZSBXRUJQX0ZPVU5ECiAgICAgICAgdmFyaWFi
bGUgaW4gY2hlY2tfaW5jbHVkZV9maWxlcygpLCBhcyBpdCB3aWxsIGxlYWQgdG8gbWlzbGVhZ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