• cef 不更新编译


    1,安装"Debugging Tools for Windows“

    Control Panel → Programs → Programs and Features → Select the “Windows Software Development Kit” → Change → Change → Check “Debugging Tools For Windows” → Change. Or, you can download the standalone SDK installer and use it to install the Debugging Tools.

    2,gn gen outDefault   

    gn gen --ide=vs --filters=//chrome;//third_party/WebKit/*;//gpu/*. --no-deps outDefault

    输入参数:(gn args out/Default) or on the gn gen command line (gn gen out/Default --args="is_component_build = true is_debug = true")

    报错 

    ERROR at //cef/BUILD.gn:140:1: Assertion failed.

    assert(!enable_print_preview)

    可以键入命令输入编译参数: gn args out/Default 在弹出的编辑notepad里面加入一行: 

    enable_print_preview = false
    enable_widevine = true
    clang_use_chrome_plugins = false

    这个文件保存在 out/Default/args.gn

     加速:

    • is_component_build = true - this uses more, smaller DLLs, and incremental linking.
    • enable_nacl = false - this disables Native Client which is usually not needed for local builds.
    • target_cpu = "x86" - x86 builds are slightly faster than x64 builds and support incremental linking for more targets. Note that if you set this but don‘t’ set enable_nacl = false then build times may get worse.
    • blink_symbol_level = 0 - turn off source-level debugging for blink to reduce build times, appropriate if you don't plan to debug blink.
      • # Build arguments go here.
        # See "gn args <out_dir> --list" for available build arguments.
        enable_print_preview = false
        enable_widevine = true
        clang_use_chrome_plugins = false
        is_component_build = true
        enable_nacl = false 
        target_cpu = "x86" 
      • ../../base/win/windows_version.cc(26,2):  error: Creators Update SDK (10.0.15063.468) required.
      • 安装windows sdk 

      • 这个原因是因为新版的win10 sdk改变了目录结构,使得编译软件无法找到必要的处理程序。解决办法如下:

        • 进入C:Program Files (x86)Windows Kits10in,将arm、armx64、x64、x86文件夹备份并删除,
        • 将10.0.15063.0文件夹中的arm、armx64、x64、x86文件夹拖出。
        • 再次运行ninja -C out.gn/x64.release
        • https://developer.microsoft.com/zh-cn/windows/downloads/ windows sdk下载。
        • //chrome_elf/BUILD.gn:10:1: Can't load input file.
          import("//cef/libcef/features/features.gni")
          
          src/build.gn remove //cef

          chrome_elf 移除 cef有关

    electron windows 构建

    构建步骤 (Windows)

    遵循下面的步骤, 在 Windows 平台上构建 Electron。

    基本要求

    • Windows 10 / Server 2012 R2 或更高版本
    • Visual Studio 2017 15.7.2 或更高版本 - 免费下载 VS 2019 社区版
      • 请参阅Chromium构建文档,以了解有哪些Visual Studio 组件需要安装等详细信息。
      • 如果您的 Visual Studio 安装在非默认目录中, 您需要 设置几个环境变量来将工具链指向您的安装路径。
        • vs2019_install = DRIVE:path oMicrosoft Visual Studio2019Community, replacing 2019 and Community with your installed versions and replacing DRIVE: with the drive that Visual Studio is on. Often, this will be C:.
        • WINDOWSSDKDIR = DRIVE:path oWindows Kits10, replacing DRIVE: with the drive that Windows Kits is on. Often, this will be C:.
    • Python 2.7.10 或更高版本
      • 与下面 depot_tools 的安装说明不同,你必须安装 2.7.10 以上版本的 Python(支持 TLS 1.2)。 为此,应确保 PATH 中 Python 的安装目录在 depot_tools 之前。 目前 depot_tools 仍捆绑 Python 2.7.6,这将导致 gclient 命令失效(见 crbug.com/868864)。
      • Python for Windows (pywin32) 扩展对于构建流程也是必需的。
      • pip是自带的。安装whl文件方法如下:
        pip install wheel。 pip install pywin32-
        227-cp27-cp27m-win_amd64.whl
    • Node.js
    • Git
    • Debugging Tools for Windows of Windows SDK 10.0.15063.468 if you plan on creating a full distribution since symstore.exe is used for creating a symbol store from .pdb files.
      • 不同版本的SDK可以同时安装 安装 SDK,打开 Visual Studio 安装程序,选择 更改单个组件,向下滚动并选择适当的 要安装的 Windows SDK 组件。 另一个选择是查看 windows SDK 和仿真器存档 并分别下载 SDK 的独立版本。
      • 还必须安装 SDK 调试工具。 如果已安装了 Windows 10 SDK 通过 Visual Studio 安装程序,然后可以用以下方式安装它们: 控制面板程序程序和功能→选择“Windows 软件开发工具包”→ 更改更改→选中“Windows 调试工具”→更改。 或者,您可以下载独立的 SDK 安装程序,并且使用它安装调试工具。

    如果您当前没有安装 Windows, dev.microsoftedge.com 上有时间限制的 Windows 版本,你可以用来构建 Electron。

    构建 Electron 完全由命令行脚本完成,无法通过 Visual Studio 完成。 您可以使用任何编辑器开发 Electron,但将来将会使用 Visual Studio 构建支持。

    Note: Even though Visual Studio is not used for building, it's still required because we need the build toolchains it provides.

    32 位构建

    为了构建 32bit 版本,您需要通过 target_cpu = “x86" 作为 GN 参数。 可以使用不同的 GN 输出目录(例如, out/Release-x86) 和不同的参数,在 64 位目标旁边构建 32 位目标。

    $ gn gen out/Release-x86 --args="import("//electron/build/args/release.gn") target_cpu="x86""
    

    其他构建步骤完全一样。

    Visual Studio 项目

    要生成 Visual Studio 项目,可以传递 --ide=vs2017 参数 给 gn gen

    $ gn gen out/Testing --ide=vs2017
    

    Command xxxx not found

    如果你遇到了一个错误,类似 Command xxxx not found, 可以尝试使用 VS2015 Command Prompt 控制台来执行构建脚本.

    Fatal internal compiler error: C1001

    确保你已经安装了 Visual Studio 的最新安装包.

    LNK1181: cannot open input file 'kernel32.lib'

    重新安装 32位的 Node.js.

    Error: ENOENT, stat 'C:UsersUSERNAMEAppDataRoaming pm'

    创建那个目录 应该可以解决问题:

    $ mkdir ~AppDataRoaming
    pm
    

    node-gyp is not recognized as an internal or external command

    如果你使用 Git Bash 来构建,或许会遇到这个错误,可以使用 PowerShell 或 VS2015 Command Prompt 来代替.

    无法在“…”处创建目录:文件名太长

    node.js 有一些 极长的路径名,默认情况下,windows 上的 git 不能正确处理长路径名(即使 windows 支持它们)。 这应该可以修复它:

    $ git config --system core.longpaths true
    

    错误:使用未声明的标识符“DefaultDelegateCheckMode”

    This can happen during build, when Debugging Tools for Windows has been installed with Windows Driver Kit. Uninstall Windows Driver Kit and install Debugging Tools with steps described above.

    导入错误:没有名为 win32file 的模块

    确保已使用 pip install pywin32 安装了 pywin32

    构建脚本挂起, 直到某个按键按下才有响应

    这个bug 是 Windows 命令提示符的一个"功能" It happens when clicking inside the prompt window with QuickEdit enabled and is intended to allow selecting and copying output text easily. 由于每次意外点击都会暂停构建过程,您可能需要在命令的属性中禁用此 功能。

  • 相关阅读:
    Vue.js整理
    linux~dd命令
    linux 开机自启动的两种方式
    解决mount.nfs: access denied by server while mounting
    pip与apt-get的使用
    Mysql 中字符串的截取
    学生练习:括号匹配
    迷宫问题,打印所有路径,深度搜索,dfs
    vector用法
    【CF1257A】Two Rival Students【思维】
  • 原文地址:https://www.cnblogs.com/bigben0123/p/12554786.html
Copyright © 2020-2023  润新知