Bug 154796

Summary: [cmake] Allow using FindGLIB in case glib is optional dependency.
Product: WebKit Reporter: Konstantin Tokarev <annulen>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, gyuyoung.kim, happydiwali2018images6014, isobelwardnar, lforschler, mcatanzaro, mrobinson, ossy, payasis382, totujuwap, yoon
Priority: P2    
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 154810    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch none

Description Konstantin Tokarev 2016-02-28 10:01:33 PST
FindGLIB caused internal CMake error in case GLIBCONFIG_INCLUDE_DIR is not defined.
Comment 1 Konstantin Tokarev 2016-02-28 10:02:50 PST
Created attachment 272459 [details]
Patch
Comment 2 WebKit Commit Bot 2016-02-28 12:10:57 PST
Comment on attachment 272459 [details]
Patch

Clearing flags on attachment: 272459

Committed r197297: <http://trac.webkit.org/changeset/197297>
Comment 3 WebKit Commit Bot 2016-02-28 12:11:01 PST
All reviewed patches have been landed.  Closing bug.
Comment 4 Gwang Yoon Hwang 2016-02-28 23:38:29 PST
I faced below linking error after this change in Fedora 22 using build-webkit script.


[1145/6100] Linking CXX shared library lib/libjavascriptcoregtk-4.0.so.18.3.4
FAILED: : && /usr/libexec/icecc/bin/clang++  -fPIC -std=c++11 -fcolor-diagnostics -Qunused-arguments -O3 -DNDEBUG -fno-exceptions -fno-strict-aliasing -fno-rtti  -Wl,--no-undefined  -L/home/yoon/workspace/WebKitGtk/WebKitBuild/DependenciesGTK/Root/lib  -fuse-ld=gold -Wl,--disable-new-dtags -fuse-ld=gold -Wl,--disable-new-dtags -shared -Wl,-soname,libjavascriptcoregtk-4.0.so.18 -o lib/libjavascriptcoregtk-4.0.so.18.3.4 @CMakeFiles/JavaScriptCore.rsp  && :
lib/libWTFGTK.a(lib/../Source/WTF/wtf/CMakeFiles/WTF.dir/glib/GRefPtr.cpp.o):../../Source/WTF/wtf/glib/GRefPtr.cpp:function _GClosure* WTF::refGPtr<_GClosure>(_GClosure*): error: undefined reference to 'g_closure_ref'
lib/libWTFGTK.a(lib/../Source/WTF/wtf/CMakeFiles/WTF.dir/glib/GRefPtr.cpp.o):../../Source/WTF/wtf/glib/GRefPtr.cpp:function void WTF::derefGPtr<_GClosure>(_GClosure*): error: undefined reference to 'g_closure_unref'
clang-3.8: error: linker command failed with exit code 1 (use -v to see invocation)

There is some notable difference between before and after this change at the CMakeCache.txt in the WebKitBuild/Release/.
Before this change, WTF_LIB_DEPENDS explicitly includes libglib-2.0.so, it is disappeared after.

FYI, Here is the diff of the CMakeCache.txt
http://pastebin.com/jS8iVb5t

Is it intended behavior?
Comment 5 Konstantin Tokarev 2016-02-29 01:39:48 PST
(In reply to comment #4)
> I faced below linking error after this change in Fedora 22 using
> build-webkit script.

Does it fix build if you revert it now?
Comment 6 Gwang Yoon Hwang 2016-02-29 01:54:32 PST
(In reply to comment #5)
> (In reply to comment #4)
> > I faced below linking error after this change in Fedora 22 using
> > build-webkit script.
> 
> Does it fix build if you revert it now?

It works with a revert on top of r197308 (mostly now)
Comment 7 WebKit Commit Bot 2016-02-29 02:02:16 PST
Re-opened since this is blocked by bug 154810
Comment 8 Konstantin Tokarev 2016-02-29 03:02:04 PST
Created attachment 272482 [details]
Patch
Comment 9 ChangSeok Oh 2016-02-29 04:22:18 PST
Comment on attachment 272482 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=272482&action=review

> Source/cmake/FindGLIB.cmake:73
> +if (EXISTS "${GLIBCONFIG_INCLUDE_DIR}/glibconfig.h")

I think "if (GLIBCONFIG_INCLUDE_DIR)" is enough. No?
Comment 10 Konstantin Tokarev 2016-02-29 04:25:40 PST
This time I want to be on the safe side :)
Comment 11 WebKit Commit Bot 2016-02-29 06:59:33 PST
Comment on attachment 272482 [details]
Patch

Clearing flags on attachment: 272482

Committed r197350: <http://trac.webkit.org/changeset/197350>
Comment 12 WebKit Commit Bot 2016-02-29 06:59:40 PST
All reviewed patches have been landed.  Closing bug.
Comment 16 payasis 2019-12-17 12:17:01 PST
I face the same bug on a website known as https://dlskitshub.com/ Therefore when I try to import the 512x512 DLS kits & their logos it will cause that that bug. Can anybody here to solve it.