Component build

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Component build

Postby PeterO » Mon Jul 17, 2017 1:43 am

I know that officially component build is not supported but I saw that in the master a commit has been made addressing this issue (#1617, commit b216f42).
I've cherry-picked this commit into my CEF branch 3112.
It's started to build the separate dll's but after a while it halts due to 'inconsistent dll linkage'.

Code: Select all
ninja -t msvc -e environment.x86 -- "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64_x86/cl.exe" /nologo /showIncludes /FC @obj/chrome_elf/crash/content_switches.obj.rsp /c ../../content/public/common/content_switches.cc /Foobj/chrome_elf/crash/content_switches.obj /Fd"obj/chrome_elf/crash_cc.pdb"
d:\bslibs\chromium\chromium\src\content\public\common\content_switches.cc(13): error C2220: warning treated as error - no 'object' file generated
d:\bslibs\chromium\chromium\src\content\public\common\content_switches.cc(13): warning C4273: 'switches::kAcceleratedCanvas2dMSAASampleCount': inconsistent dll linkage
d:\bslibs\chromium\chromium\src\content\public\common\content_switches.h(18): note: see previous definition of 'kAcceleratedCanvas2dMSAASampleCount'
d:\bslibs\chromium\chromium\src\content\public\common\content_switches.cc(21): warning C4273: 'switches::kAecRefinedAdaptiveFilter': inconsistent dll linkage
d:\bslibs\chromium\chromium\src\content\public\common\content_switches.h(19): note: see previous definition of 'kAecRefinedAdaptiveFilter'
etc.
PeterO
Techie
 
Posts: 16
Joined: Tue Dec 10, 2013 1:44 am

Re: Component build

Postby magreenblatt » Mon Jul 17, 2017 12:40 pm

Did everything apply successfully including the Chromium patch changes?
magreenblatt
Site Admin
 
Posts: 12402
Joined: Fri May 29, 2009 6:57 pm

Re: Component build

Postby PeterO » Tue Jul 18, 2017 5:23 am

Succeeded!
Seemed to be caused by mixed CRLF and LF ending introduced by invoking the wrong git installation in a earlier phase.
Reverted all Chromium patches, removed CEF and out dir.
Started automate building again.
Changed the config (args.gn) in the out dirs to be component build.
All files compiled well.
Linking failed on one unresolved external: WebContentsView::GetScreenInfo.
Added CONTENT_EXPORT to the class et voila: CefClient works!
Thanks Maestro!
PeterO
Techie
 
Posts: 16
Joined: Tue Dec 10, 2013 1:44 am

Re: Component build

Postby PeterO » Tue Jul 18, 2017 3:54 pm

Did work so nicely this morning.
Made some changes in my own build script.
Started again to see if the script works but now I'm stuck with this error:
Code: Select all
-------- Running "ninja -C out\Debug_GN_x86 cefclient" in "d:\libs\Chromium\chromium\src"...
ninja: Entering directory `out\Debug_GN_x86'
[335/29267] CXX obj/cef/chrome_elf_set/chrome_switches.obj
FAILED: obj/cef/chrome_elf_set/chrome_switches.obj
ninja -t msvc -e environment.x86 -- "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64_x86/cl.exe" /nologo /showIncludes /FC @obj/cef/chrome_elf_set/chrome_switches.obj.rsp /c ../../chrome/common/chrome_switches.cc /Foobj/cef/chrome_elf_set/chrome_switches.obj /Fd"obj/cef/chrome_elf_set_cc.pdb"
d:\libs\chromium\chromium\src\chrome\common\chrome_switches.h(12): fatal error C1083: Cannot open include file: 'chrome/common/features.h': No such file or directory
[344/29267] CXX obj/base/base/trace_log.obj
ninja: build stopped: subcommand failed.

As far as I can see followed the same steps.
PeterO
Techie
 
Posts: 16
Joined: Tue Dec 10, 2013 1:44 am

Re: Component build

Postby magreenblatt » Tue Jul 18, 2017 4:01 pm

It's possible that the component build is non-deterministic. I haven't tested it very much yet. Expect improvements over a few Chromium bumps.
magreenblatt
Site Admin
 
Posts: 12402
Joined: Fri May 29, 2009 6:57 pm

Re: Component build

Postby PeterO » Wed Jul 19, 2017 10:31 am

Solved it by adding some deps in cef/BUILD.gn to the chrome_elf_set target.
Patch supplied.
Attachments
cef_component_build.zip
(391 Bytes) Downloaded 402 times
PeterO
Techie
 
Posts: 16
Joined: Tue Dec 10, 2013 1:44 am

Re: Component build

Postby magreenblatt » Wed Jul 19, 2017 10:55 am

PeterO wrote:Solved it by adding some deps in cef/BUILD.gn to the chrome_elf_set target.
Patch supplied.

Thanks, those changes should be fine. Here's the patch inline for convenience:

Code: Select all
diff --git a/BUILD.gn b/BUILD.gn
index fe144b7..71e9bab 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -314,6 +314,9 @@ if (is_win) {
     deps = [
       "//components/crash/core/common",  # crash_keys
       "//gpu/config:crash_keys",
+      "//chrome/common:features",
+      "//ppapi/features:features",
+      "//printing/features:features",
     ]
   }
 }
magreenblatt
Site Admin
 
Posts: 12402
Joined: Fri May 29, 2009 6:57 pm

Re: Component build

Postby PeterO » Wed Jul 19, 2017 1:51 pm

On running the CefClient tests, all tests invoking CefJavaScriptDialogRunnerWin::Run crashes.
This is the code where it fails:
Code: Select all
  // Try to load the dialog from the DLL.
  if (PathService::Get(base::FILE_MODULE, &file_path))
    hModule = ::GetModuleHandle(file_path.value().c_str());
  if (!hModule)
    hModule = ::GetModuleHandle(NULL);
  DCHECK(hModule);

  parent_win_ = GetAncestor(browser->GetWindowHandle(), GA_ROOT);
  dialog_win_ =
      CreateDialogParam(hModule, MAKEINTRESOURCE(dialog_type), parent_win_,
                        DialogProc, reinterpret_cast<LPARAM>(this));
  DCHECK(dialog_win_);

CreateDialogParam returns nothing (nullptr).
The handle to base.dll seems to be valid (hModule is 0x10000000)
parent_win_ has a pointer as well.
PeterO
Techie
 
Posts: 16
Joined: Tue Dec 10, 2013 1:44 am

Re: Component build

Postby magreenblatt » Wed Jul 19, 2017 5:52 pm

magreenblatt
Site Admin
 
Posts: 12402
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 44 guests