如何将CEF3嵌入到我的OSX应用程序中?

Mar*_*ark 5 browser macos xcode chromium swift

我喜欢在我的OS X项目中使用Chromium浏览器而不是WebKit浏览器.

  1. 我在https://cefbuilds.com下载了二进制文件
  2. 我用cmake构建了一个cef.xcodeproj.
  3. 一旦我打开它并想要构建它.它首先给我带来问题,因为虚拟bool Execute需要被覆盖.当我解决了这个错误时,它会进一步发展,但会崩溃:

    cefsimple /bin/sh: tools/make_more_helpers.sh: /bin/bash: bad interpreter: Operation not permitted
    make: *** [cefsimple_buildpart_2] Error 126
    Command /bin/sh failed with exit code 2
    
    Run Code Online (Sandbox Code Playgroud)

谁能解释我做错了什么?

l'L*_*L'l 2

在 OS X 版本 10.7.4 及更高版本中,扩展属性被添加到可执行文件(包括 shell 脚本)中,并由您为帐户定义的安全设置进行处理。例如,检查xattr您的构建脚本之一可能类似于以下内容:

\n\n
$ ls -l@ make_more_helpers.sh\n-rwxr-xr-x@  1 Hellman  staff  3564 Sep  2 07:02 make_more_helpers.sh\n         com.apple.quarantine          23\n
Run Code Online (Sandbox Code Playgroud)\n\n

当 Xcode 尝试执行脚本时(同样取决于您的安全设置),它将查看扩展属性并确定是否允许其执行。如果发现脚本的创建者尚未获得批准,您将收到如下错误:

\n\n
make_more_helpers.sh: /bin/bash: bad interpreter: Operation not permitted\n
Run Code Online (Sandbox Code Playgroud)\n\n

幸运的是,这是一个简单的修复,并且有很多方法可以修复它。其中一种方法是将属于您使用 Xcode 构建的项目一部分的脚本关联起来。您还可以在允许运行脚本的编辑器中打开脚本并重新保存它,或者只是递归扫描构建目录以查找具有隔离属性的文件并删除该属性:

\n\n
xattr -rd com.apple.quarantine /path/to/build\n
Run Code Online (Sandbox Code Playgroud)\n\n

执行此操作后,您应该注意到ls -l@在脚本上执行另一个@操作,以下权限com.apple.quarantine应被删除。现在,当您尝试构建项目时,应该允许脚本执行并成功。

\n\n

\xe2\x86\xb3 https://developer.apple.com/library/mac/documentation/OpenSource/Conceptual/ShellScripting/BeforeYouBegin/BeforeYouBegin.html

\n