Bug 165985 - [CMake] TestWebKitAPIBase links to itself
Summary: [CMake] TestWebKitAPIBase links to itself
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Linux
: P2 Normal
Assignee: Michael Catanzaro
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-16 19:36 PST by Michael Catanzaro
Modified: 2016-12-19 11:13 PST (History)
6 users (show)

See Also:


Attachments
Patch (1.35 KB, patch)
2016-12-17 06:54 PST, Michael Catanzaro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2016-12-16 19:36:14 PST
CMake Warning (dev) at Tools/TestWebKitAPI/CMakeLists.txt:199 (add_library):
  Policy CMP0038 is not set: Targets may not link directly to themselves.
  Run "cmake --help-policy CMP0038" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  Target "TestWebKitAPIBase" links to itself.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at Tools/TestWebKitAPI/CMakeLists.txt:199 (add_library):
  Policy CMP0038 is not set: Targets may not link directly to themselves.
  Run "cmake --help-policy CMP0038" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  Target "TestWebKitAPIBase" links to itself.
This warning is for project developers.  Use -Wno-dev to suppress it.
Comment 1 Michael Catanzaro 2016-12-17 06:53:01 PST
I think I hate linkers.

This fixes the warnings and it links, but there's got to be a be a better way. I ran into linker errors when I tried anything else, though. In particular, it won't link if I remove TestWebKitAPIBase from test_webkit2_api_LIBRARIES and specify it manually in target_link_libraries for the tests.
Comment 2 Michael Catanzaro 2016-12-17 06:54:23 PST
Created attachment 297403 [details]
Patch
Comment 3 Konstantin Tokarev 2016-12-17 11:16:34 PST
LGTM

I don't think linker can take any blame here, it might be cmake but most probably our project structure
Comment 4 WebKit Commit Bot 2016-12-19 11:13:19 PST
Comment on attachment 297403 [details]
Patch

Clearing flags on attachment: 297403

Committed r209991: <http://trac.webkit.org/changeset/209991>
Comment 5 WebKit Commit Bot 2016-12-19 11:13:23 PST
All reviewed patches have been landed.  Closing bug.