我想在CEF里使用PPAPI,CEF使用VS 2013 Update 4编译。因此我尝试了使用VS 2013来编译PPAPI插件。
PPAPI的代码在这里:https://chromium.googlesource.com/chromium/src/ppapi/,可以用下列命令check出来:
git clone https://chromium.googlesource.com/chromium/src/ppapi
也可以下载master分支的tgz包。
VS工程
新建一个Win32项目,类型选DLL,去掉预编译头文件stdafx.h和stdafx.cpp,并且在项目属性–>配置属性–>C/C++–>预编译头,把预编译头选项的值设置为不使用预编译头。
复制ppapi/examples/stub/stub.c文件到项目文件夹下,并添加到项目里。做简单修改,打印点儿调试信息。stub.c内容如下:
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This is the simplest possible C Pepper plugin that does nothing. If you're
// using C++, you will want to look at stub.cc which uses the