Window10下VS2019编译 Chromium

按照官方的操作说明(https://bitbucket.org/chromiumembedded/cef/wiki/MasterBuildQuickStart.md#markdown-header-windows-setup)编译会出现不少问题

1、首先如果安装的是版本的(Python 3.0以上),在调用(create.bat)生成工程会有一个接口报错,编译会被阻塞

unicode("", "utf-8")这个函数在python 3.0版本已经被废除了,因此需要切换道python 2.7才能编译通过,在安装python 2.1以后需要重新配置python的系统路径,确保优先运行低版本的python

2、在编译skia的时候会遇到如下错误:

In file included from ../../cef/libcef/renderer/blink_glue.cc:12:
In file included from ../..\third_party/blink/public/web/web_document.h:40:
In file included from ../..\third_party/blink/public/web/web_frame.h:35:
In file included from ../..\cc/paint/paint_canvas.h:13:
In file included from ../..\cc/paint/paint_image.h:18:
In file included from ../..\third_party/skia/include/core/SkImage.h:11:
In file included from ../../third_party/skia\include/core/SkImageEncoder.h:12:
In file included from ../../third_party/skia\include/core/SkBitmap.h:11:
In file included from ../../third_party/skia\include/core/SkColor.h:11:
In file included from ../../third_party/skia\include/core/SkImageInfo.h:11:
In file included from ../../third_party/skia\include/core/SkColorSpace.h:11:
In file included from ../../third_party/skia\include/core/SkRefCnt.h:11:
../../third_party/skia\include/core/SkTypes.h(192,14): error: #include resolved using non-portable Microsoft search rules as: ../..\cc/paint/../../skia/config/SkUserConfig.h [-Werror,-Wmicrosoft-include]
    #include SK_USER_CONFIG_HEADER
             ^
<command line>(61,31): note: expanded from here
#define SK_USER_CONFIG_HEADER "../../skia/config/SkUserConfig.h"

查阅资料,主要原因是不同编译器查找头文件规则不同,修改SkTypes.h 191行

// IWYU pragma: begin_exports
#undef SK_USER_CONFIG_HEADER
#if defined (SK_USER_CONFIG_HEADER)
    #include SK_USER_CONFIG_HEADER
#else
    #include "include/config/SkUserConfig.h"
#endif

再编译时这个问题就消失了

3、出现SkDrawLooper is unsupported为问题

In file included from ../../cc/layers/recording_source.cc:13:
In file included from ../..\cc/layers/content_layer_client.h:11:
In file included from ../..\cc/paint/display_item_list.h:18:
In file included from ../..\cc/paint/discardable_image_map.h:19:
In file included from ../..\cc/paint/paint_flags.h:13:
../..\third_party/skia/include/core/SkDrawLooper.h(20,2): error: "SkDrawLooper is unsupported"
#error "SkDrawLooper is unsupported"

查看了skia的源码SkDrawLooper.h,明确写了不支持,不知道为什么还要include这个文件

/** \class SkDrawLooper
    DEPRECATED: No longer supported in Skia.
*/
class SK_API SkDrawLooper : public SkFlattenable {
public:

把paint_flags.h中包含文件去掉

#include "third_party/skia/include/core/SkColorFilter.h"
//#include "third_party/skia/include/core/SkDrawLooper.h"

会出错

In file included from ../..\cc/paint/paint_filter.h:13:
../..\cc/paint/paint_flags.h(142,29): error: use of undeclared identifier 'SkDrawLooper'
  ALWAYS_INLINE const sk_sp<SkDrawLooper>& getLooper() const {
                            ^
../..\cc/paint/paint_flags.h(145,38): error: use of undeclared identifier 'SkDrawLooper'
  ALWAYS_INLINE void setLooper(sk_sp<SkDrawLooper> looper) {
                                     ^
../..\cc/paint/paint_flags.h(187,9): error: use of undeclared identifier 'SkDrawLooper'
  sk_sp<SkDrawLooper> draw_looper_;
        ^
../..\cc/paint/paint_flags.h(165,21): error: use of undeclared identifier 'SkDrawLooper'
    if (const sk_sp<SkDrawLooper>& looper = getLooper())

看来还是调用这个类,只好修改SkDrawLooper.h,将报错内容注释掉

/*
#ifndef SK_SUPPORT_LEGACY_DRAWLOOPER
#error "SkDrawLooper is unsupported"
#endif
*/

这一块就可以编译通过,不过新的问题又来了

../../cc/paint/paint_shader.cc(463,47): error: no matching member function for call to 'makeShader'
        cached_shader_ = image_.GetSkImage()->makeShader(
                         ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
..

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

山中涛大爷

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值