Bug 160904 - Use find_library within Windows build
Summary: Use find_library within Windows build
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 160949
Blocks:
  Show dependency treegraph
 
Reported: 2016-08-16 11:41 PDT by Don Olmstead
Modified: 2016-08-17 16:31 PDT (History)
8 users (show)

See Also:


Attachments
FindICU fixes (13.34 KB, patch)
2016-08-16 15:50 PDT, Don Olmstead
no flags Details | Formatted Diff | Diff
FindICU fixes (6.50 KB, patch)
2016-08-16 15:52 PDT, Don Olmstead
no flags Details | Formatted Diff | Diff
FindICU fixes (6.33 KB, patch)
2016-08-16 16:15 PDT, Don Olmstead
no flags Details | Formatted Diff | Diff
FindICU fixes (7.75 KB, patch)
2016-08-16 16:30 PDT, Don Olmstead
no flags Details | Formatted Diff | Diff
FindICU with comments (6.08 KB, patch)
2016-08-16 19:09 PDT, Don Olmstead
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews122 for ios-simulator-elcapitan-wk2 (769.34 KB, application/zip)
2016-08-16 21:28 PDT, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Don Olmstead 2016-08-16 11:41:49 PDT
Currently the Windows implementation does not use the Find* in Source/cmake. For consistency it would be great to have the Windows implementation using Find for its implementation.

This is a meta bug for figuring out how to go about this and then start going after each individual library.
Comment 1 Don Olmstead 2016-08-16 11:49:36 PDT
On Windows WebKitLibraries/win is the root for third party libraries in the project. In CMake the WEBKIT_LIBRARIES_DIR is set for this. So within FindICU.cmake you can do the following which allows Windows to find it.

find_path(
    ICU_INCLUDE_DIR
    NAMES unicode/utypes.h
    HINTS ${PC_ICU_INCLUDE_DIRS}
          ${PC_ICU_INCLUDEDIR}
          ${WEBKIT_LIBRARIES_DIR}/include
    DOC "Include directory for the ICU library")
mark_as_advanced(ICU_INCLUDE_DIR)

One thing I'm wondering however is should the be a WEBKIT_LIBRARIES_ROOT and then some variables around that be added. So WEBKIT_LIBRARIES_INCLUDE_DIR/WEBKIT_LIBRARIES_LINKER_DIR which would then be used within the HINTS section.
Comment 2 Don Olmstead 2016-08-16 15:50:45 PDT
Created attachment 286219 [details]
FindICU fixes

Uses find_package(ICU REQUIRED) for Windows builds
Comment 3 Don Olmstead 2016-08-16 15:52:55 PDT
Created attachment 286221 [details]
FindICU fixes
Comment 4 Don Olmstead 2016-08-16 16:15:43 PDT
Created attachment 286228 [details]
FindICU fixes
Comment 5 Don Olmstead 2016-08-16 16:30:32 PDT
Created attachment 286231 [details]
FindICU fixes

One more time...hopefully
Comment 6 Alex Christensen 2016-08-16 16:34:07 PDT
Comment on attachment 286228 [details]
FindICU fixes

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

This needs a ChangeLog entry.  Please use Tools/Scripts/prepare-ChangeLog to generate templates.

> Source/cmake/OptionsWin.cmake:106
> +    # TODO Remove ${WEBKIT_LIBRARIES_LINK_DIR} when find_library is used for everything

FIXME: is used in WebKit.

> Source/cmake/OptionsWin.cmake:113
> +include(WebKitLibraries)

The contents of WebKitLibraries.cmake should probably just go here instead of making another file.

> Source/cmake/OptionsWin.cmake:115
> +include_directories("${CMAKE_BINARY_DIR}/DerivedSources/ForwardingHeaders" "${CMAKE_BINARY_DIR}/DerivedSources" "${WEBKIT_LIBRARIES_INCLUDE_DIR}")

This should not be here.

> Source/cmake/OptionsWinCairo.cmake:5
> +find_package(ICU REQUIRED)

This is needed for AppleWin, too.

> Source/cmake/WebKitLibraries.cmake:17
> +        set(WEBKIT_LIBRARIES_LINK_DIR "${WEBKIT_LIBRARIES_DIR}/lib")

If this were in OptionsWin, it would be more obvious that this only applies when building for your port.
Comment 7 Don Olmstead 2016-08-16 16:57:56 PDT
(In reply to comment #6)
> Comment on attachment 286228 [details]
> FindICU fixes
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=286228&action=review
> 
> This needs a ChangeLog entry.  Please use Tools/Scripts/prepare-ChangeLog to
> generate templates.
> 

Still working my way around prepare-Changelog. Should have the hang of it soon.

> > Source/cmake/OptionsWin.cmake:106
> > +    # TODO Remove ${WEBKIT_LIBRARIES_LINK_DIR} when find_library is used for everything
> 
> FIXME: is used in WebKit.
> 
> > Source/cmake/OptionsWin.cmake:113
> > +include(WebKitLibraries)
> 
> The contents of WebKitLibraries.cmake should probably just go here instead
> of making another file.
> 

I had planned on using the file within our out of trunk port till it can land. I've been following the same conventions within it.

> > Source/cmake/OptionsWin.cmake:115
> > +include_directories("${CMAKE_BINARY_DIR}/DerivedSources/ForwardingHeaders" "${CMAKE_BINARY_DIR}/DerivedSources" "${WEBKIT_LIBRARIES_INCLUDE_DIR}")
> 
> This should not be here.

Not sure what you mean here. It should be equivalent to what was at that position.

> 
> > Source/cmake/OptionsWinCairo.cmake:5
> > +find_package(ICU REQUIRED)
> 
> This is needed for AppleWin, too.
> 

I'll move it to OptionsWin.

> > Source/cmake/WebKitLibraries.cmake:17
> > +        set(WEBKIT_LIBRARIES_LINK_DIR "${WEBKIT_LIBRARIES_DIR}/lib")
> 
> If this were in OptionsWin, it would be more obvious that this only applies
> when building for your port.
Comment 8 Don Olmstead 2016-08-16 19:09:28 PDT
Created attachment 286250 [details]
FindICU with comments

Ok this is a straightforward version of the patch with the include taken out.
Comment 9 Build Bot 2016-08-16 21:28:05 PDT
Comment on attachment 286250 [details]
FindICU with comments

Attachment 286250 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/1884804

New failing tests:
fast/scrolling/ios/scrollTo-at-page-load.html
Comment 10 Build Bot 2016-08-16 21:28:08 PDT
Created attachment 286266 [details]
Archive of layout-test-results from ews122 for ios-simulator-elcapitan-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews122  Port: ios-simulator-elcapitan-wk2  Platform: Mac OS X 10.11.5
Comment 11 Brent Fulgham 2016-08-17 15:17:03 PDT
Comment on attachment 286250 [details]
FindICU with comments

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

I can confirm that this patch builds properly on a local Windows development machine. The build failure was due to an existing WIndows problem that has since been fixed.

Note that we need to land Bug 160949 before this one.

> Source/cmake/FindICU.cmake:82
> +        set(ICU_DATA_LIBRARIES)

I wonder if set(ICU_DATA_LIBRARIES ${ICU_DATA_LIBRARY}) just does the right thing in the case of no ICU_DATA_LIBRARY value...
Comment 12 Brent Fulgham 2016-08-17 15:22:14 PDT
I don't see how this CMake change possibly affects the iOS simulator build, given that none of the iOS or macOS builds use CMake.
Comment 13 Don Olmstead 2016-08-17 16:02:49 PDT
(In reply to comment #11)
> Comment on attachment 286250 [details]
> FindICU with comments
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=286250&action=review
> 
> I can confirm that this patch builds properly on a local Windows development
> machine. The build failure was due to an existing WIndows problem that has
> since been fixed.
> 
> Note that we need to land Bug 160949 before this one.
> 
> > Source/cmake/FindICU.cmake:82
> > +        set(ICU_DATA_LIBRARIES)
> 
> I wonder if set(ICU_DATA_LIBRARIES ${ICU_DATA_LIBRARY}) just does the right
> thing in the case of no ICU_DATA_LIBRARY value...

It should. In our setup we have the data libraries and it works fine. On WinCairo it didnt find them and I don't see it in the Additional Dependencies within VS.
Comment 14 WebKit Commit Bot 2016-08-17 16:31:26 PDT
Comment on attachment 286250 [details]
FindICU with comments

Clearing flags on attachment: 286250

Committed r204581: <http://trac.webkit.org/changeset/204581>
Comment 15 WebKit Commit Bot 2016-08-17 16:31:32 PDT
All reviewed patches have been landed.  Closing bug.