diff --git a/.gitignore b/.gitignore index 46f42f8..15685ae 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,6 @@ install_manifest.txt compile_commands.json CTestTestfile.cmake _deps +build/ +.vscode/ +.cache/ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..588fb8c --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.20) +project(aya-cef-subprocess) + +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") + +# JACKDS DOING BELOW: +set(CEF_USE_SANDBOX TRUE CACHE BOOL "Force turning off of sandbox") +set(CEF_VERSION 123.0.13+gfc703fb+chromium-123.0.6312.124) +set(cefName cef_binary_${CEF_VERSION}_windows64) + +include(cef_cmake.cmake) +add_subdirectory(cef_cmake) +link_directories(${CMAKE_SOURCE_DIR}/cef_cmake/${cefName}/Release/) +link_directories(${CMAKE_SOURCE_DIR}/build/cef_cmake/) + +add_executable(aya-cef-subprocess WIN32 main.cpp) +target_link_libraries(aya-cef-subprocess libcef cefdll_wrapper) \ No newline at end of file diff --git a/cef_cmake.cmake b/cef_cmake.cmake new file mode 100644 index 0000000..bdcfdc5 --- /dev/null +++ b/cef_cmake.cmake @@ -0,0 +1,60 @@ +# CEF-CMake 1.0.0 +# Copyright (c) 2019 Borislav Stanimirov +# +# Distributed under the MIT Software License +# See accompanying file LICENSE.txt or copy at +# http://opensource.org/licenses/MIT +# +# Configuration file for CEF-CMake +# Include in your root CMakeLists.txt +# (or, stricly speaking, the root CMakeLists to all CEF-related projects) +set(CEF_CMAKE_INCLUDED YES) + +option(CEF_USE_SANDBOX "CEF-CMake: Enable or disable use of the CEF sandbox." ON) + +if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") + set(CEF_CMAKE_OS_MACOSX 1) + set(CEF_CMAKE_OS_POSIX 1) +elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") + set(CEF_CMAKE_OS_LINUX 1) + set(CEF_CMAKE_OS_POSIX 1) +elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") + set(CEF_CMAKE_OS_WINDOWS 1) +else() + message(FATAL_ERROR "CEF-CMake: Unsupported target platform") +endif() + +# Set a default build type if none was specified +# MSVC has no Default build type anyway, so skip this +if(NOT MSVC AND NOT CMAKE_BUILD_TYPE) + message(WARNING "CEF-CMake: 'Default' build type is not supported by CEF-CMake. Setting build type to 'Debug'.") + set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE) + # Set the possible values of build type for cmake-gui + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") +endif() + +if(MSVC AND CEF_USE_SANDBOX) + message(STATUS "CEF-CMake: Replacing /MD->/MT in C and CXX_FLAGS. Required by CEF sandbox.") + set(CompilerFlags + CMAKE_CXX_FLAGS + CMAKE_CXX_FLAGS_DEBUG + CMAKE_CXX_FLAGS_RELEASE + CMAKE_C_FLAGS + CMAKE_C_FLAGS_DEBUG + CMAKE_C_FLAGS_RELEASE + ) + foreach(CompilerFlag ${CompilerFlags}) + string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}") + endforeach() +endif() + +if(CEF_CMAKE_OS_WINDOWS) + set(CEF_CMAKE_EXECUTABLE_RESOURCES + ${CMAKE_CURRENT_LIST_DIR}/../res/win/cef.exe.manifest + ${CMAKE_CURRENT_LIST_DIR}/../res/win/compatibility.manifest + ) +elseif(CEF_CMAKE_OS_MACOSX) + message(FATAL_ERROR "CEF-CMake: Executable resources for platform not supported yet") +else() + set(CEF_CMAKE_EXECUTABLE_RESOURCES) +endif() diff --git a/cef_cmake/.gitignore b/cef_cmake/.gitignore new file mode 100644 index 0000000..7ab7d13 --- /dev/null +++ b/cef_cmake/.gitignore @@ -0,0 +1,2 @@ +# cef binary packages which are downloaded by cmake +cef_binary_* diff --git a/cef_cmake/CMakeLists.txt b/cef_cmake/CMakeLists.txt new file mode 100644 index 0000000..1b3d84f --- /dev/null +++ b/cef_cmake/CMakeLists.txt @@ -0,0 +1,201 @@ +# CEF-CMake 1.0.0 +# Copyright (c) 2019 Borislav Stanimirov +# +# Distributed under the MIT Software License +# See accompanying file LICENSE.txt or copy at +# http://opensource.org/licenses/MIT +# +if(NOT CEF_CMAKE_INCLUDED) + message(FATAL_ERROR "CEF-CMake: Configuration not included. You need to include `cef_cmake` in your root CMakeLists.txt file") +endif() + +if(NOT CEF_VERSION) + set(CEF_VERSION 123.0.13+gfc703fb+chromium-123.0.6312.124) + message(STATUS "CEF-CMake: CEF_VERSION not specified. Defaulting to ${CEF_VERSION}") +endif() + +if(NOT CEF_CMAKE_OUTPUT_DIR) + if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) + message(SEND_ERROR "CEF-CMake: Neither CEF_CMAKE_OUTPUT_DIR nor CMAKE_RUNTIME_OUTPUT_DIRECTORY was specified. You need to specify one for the binary assets of CEF to be copied.") + endif() + # CEF_CMAKE_OUTPUT_DIR is used to copy the required shared libraries next to the executable + set(CEF_CMAKE_OUTPUT_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + message(STATUS "CEF-CMake: CEF_CMAKE_OUTPUT_DIR was not specified. Defaulting to CMAKE_RUNTIME_OUTPUT_DIRECTORY: ${CEF_CMAKE_OUTPUT_DIR}") +endif() + +if(CMAKE_BUILD_TYPE STREQUAL "Debug") + set(CURRENT_BUILD_TYPE "Debug") +else() + set(CURRENT_BUILD_TYPE "Release") +endif() + +message(STATUS "Configured CURRENT_BUILD_TYPE as ${CURRENT_BUILD_TYPE}") + +if(MSVC) + set(CEF_CMAKE_OUTPUT_DIR ${CEF_CMAKE_OUTPUT_DIR}/${CURRENT_BUILD_TYPE}) +endif() + +if(CEF_CMAKE_OS_LINUX) + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(cefName cef_binary_${CEF_VERSION}_linux64) + else() + set(cefName cef_binary_${CEF_VERSION}_linux32) + endif() +elseif(CEF_CMAKE_OS_WINDOWS) + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(cefName cef_binary_${CEF_VERSION}_windows64) + else() + set(cefName cef_binary_${CEF_VERSION}_windows32) + endif() +else() + message(FATAL_ERROR "CEF-CMake: Download platform not supported yet") +endif() + +set(cefArchiveURL https://cef-builds.spotifycdn.com/${cefName}.tar.bz2) +# fix the url as the version may contain pluses +string(REGEX REPLACE "\\+" "%2B" cefArchiveURL ${cefArchiveURL}) +set(cefArchive ${CMAKE_CURRENT_SOURCE_DIR}/${cefName}.tar.bz2) + +if(NOT EXISTS ${cefArchive}) + # download cef version + message(STATUS "CEF-CMake: Downloading CEF ${cefArchiveURL}") + file(DOWNLOAD ${cefArchiveURL} ${cefArchive} + SHOW_PROGRESS + ) + + # ... and extract + message(STATUS "CEF-CMake: Extracting ${cefArchive}") + execute_process( + COMMAND ${CMAKE_COMMAND} -E tar xzf ${cefArchive} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + ) +endif() + +set(srcs) +set(wdir ${cefName}/libcef_dll) +file(GLOB_RECURSE srcs "${wdir}/*.cc" "${wdir}/*.mm" "${wdir}/*.h" "${cefName}/include/*.h") + +add_library(cefdll_wrapper STATIC ${srcs}) + +target_compile_definitions(cefdll_wrapper + PRIVATE + # Creating the CEF wrapper library. Do not define this for dependent targets. + -DWRAPPING_CEF_SHARED + PUBLIC + # Allow C++ programs to use stdint.h macros specified in the C99 standard that aren't + # in the C++ standard (e.g. UINT8_MAX, INT64_MIN, etc) + -D__STDC_CONSTANT_MACROS + -D__STDC_FORMAT_MACROS +) + +target_include_directories(cefdll_wrapper + PUBLIC ${cefName} + INTERFACE include +) + +add_custom_command(TARGET cefdll_wrapper POST_BUILD + COMMENT "cefdll_wrapper: Copying CEF resources" + COMMAND ${CMAKE_COMMAND} -E + make_directory ${CEF_CMAKE_OUTPUT_DIR} + COMMAND ${CMAKE_COMMAND} -E copy_directory + ${CMAKE_CURRENT_SOURCE_DIR}/${cefName}/Resources/locales + ${CEF_CMAKE_OUTPUT_DIR}/locales + #COMMAND ${CMAKE_COMMAND} -E copy_if_different + # ${CMAKE_CURRENT_SOURCE_DIR}/${cefName}/Resources/cef.pak + # ${CMAKE_CURRENT_SOURCE_DIR}/${cefName}/Resources/cef_100_percent.pak + # ${CMAKE_CURRENT_SOURCE_DIR}/${cefName}/Resources/cef_200_percent.pak + # ${CMAKE_CURRENT_SOURCE_DIR}/${cefName}/Resources/cef_extensions.pak + # ${CMAKE_CURRENT_SOURCE_DIR}/${cefName}/Resources/devtools_resources.pak + # ${CMAKE_CURRENT_SOURCE_DIR}/${cefName}/Resources/icudtl.dat + # ${CEF_CMAKE_OUTPUT_DIR} +) + +if(CEF_CMAKE_OS_LINUX) + target_link_libraries(cefdll_wrapper INTERFACE + X11 + pthread + debug ${CMAKE_CURRENT_SOURCE_DIR}/${cefName}/Debug/libcef.so + optimized ${CMAKE_CURRENT_SOURCE_DIR}/${cefName}/Release/libcef.so + ) + + add_custom_command(TARGET cefdll_wrapper POST_BUILD + COMMENT "cefdll_wrapper: Copying CEF binaries" + COMMAND ${CMAKE_COMMAND} -E + make_directory ${CEF_CMAKE_OUTPUT_DIR} + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${CMAKE_CURRENT_SOURCE_DIR}/${cefName}/${CURRENT_BUILD_TYPE}/chrome_elf.dll + ${CMAKE_CURRENT_SOURCE_DIR}/${cefName}/${CURRENT_BUILD_TYPE}/d3dcompiler_47.dll + ${CMAKE_CURRENT_SOURCE_DIR}/${cefName}/${CURRENT_BUILD_TYPE}/libEGL.dll + ${CMAKE_CURRENT_SOURCE_DIR}/${cefName}/${CURRENT_BUILD_TYPE}/libGLESv2.dll + ${CMAKE_CURRENT_SOURCE_DIR}/${cefName}/${CURRENT_BUILD_TYPE}/snapshot_blob.bin + ${CMAKE_CURRENT_SOURCE_DIR}/${cefName}/${CURRENT_BUILD_TYPE}/vk_swiftshader.dll + ${CMAKE_CURRENT_SOURCE_DIR}/${cefName}/${CURRENT_BUILD_TYPE}/vulkan-1.dll + ${CEF_CMAKE_OUTPUT_DIR} + ) + + + if(CEF_USE_SANDBOX) + target_compile_definitions(cefdll_wrapper + PUBLIC -DCEF_USE_SANDBOX + ) + endif() + +elseif(CEF_CMAKE_OS_WINDOWS) + + target_compile_definitions(cefdll_wrapper PUBLIC + -DNOMINMAX + -DWIN32_LEAN_AND_MEAN + -DUNICODE + -D_UNICODE + ) + + message(${CMAKE_CURRENT_SOURCE_DIR}/${cefName}/Release/) + link_directories(${CMAKE_CURRENT_SOURCE_DIR}/${cefName}/Release/) + + target_link_libraries(cefdll_wrapper PUBLIC + comctl32.lib + rpcrt4.lib + shlwapi.lib + ws2_32.lib + ${CMAKE_CURRENT_SOURCE_DIR}/${cefName}/Release/libcef.lib + #debug ${CMAKE_CURRENT_SOURCE_DIR}/${cefName}/Debug/libcef.lib + #optimized ${CMAKE_CURRENT_SOURCE_DIR}/${cefName}/Release/libcef.lib + ) + + add_custom_command(TARGET cefdll_wrapper POST_BUILD + COMMENT "cefdll_wrapper: Copying CEF binaries" + COMMAND ${CMAKE_COMMAND} -E + make_directory ${CEF_CMAKE_OUTPUT_DIR} + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${CMAKE_CURRENT_SOURCE_DIR}/${cefName}/${CURRENT_BUILD_TYPE}/chrome_elf.dll + ${CMAKE_CURRENT_SOURCE_DIR}/${cefName}/${CURRENT_BUILD_TYPE}/d3dcompiler_47.dll + ${CMAKE_CURRENT_SOURCE_DIR}/${cefName}/${CURRENT_BUILD_TYPE}/libEGL.dll + ${CMAKE_CURRENT_SOURCE_DIR}/${cefName}/${CURRENT_BUILD_TYPE}/libGLESv2.dll + ${CMAKE_CURRENT_SOURCE_DIR}/${cefName}/${CURRENT_BUILD_TYPE}/snapshot_blob.bin + ${CMAKE_CURRENT_SOURCE_DIR}/${cefName}/${CURRENT_BUILD_TYPE}/vk_swiftshader.dll + ${CMAKE_CURRENT_SOURCE_DIR}/${cefName}/${CURRENT_BUILD_TYPE}/vulkan-1.dll + ${CEF_CMAKE_OUTPUT_DIR} + ) + + if(CEF_USE_SANDBOX) + target_compile_definitions(cefdll_wrapper + PUBLIC + -DCEF_USE_SANDBOX + -DPSAPI_VERSION=1 + ) + + target_link_libraries(cefdll_wrapper PUBLIC + dbghelp.lib + psapi.lib + version.lib + wbemuuid.lib + winmm.lib + debug ${CMAKE_CURRENT_SOURCE_DIR}/${cefName}/Debug/cef_sandbox.lib + optimized ${CMAKE_CURRENT_SOURCE_DIR}/${cefName}/Release/cef_sandbox.lib + ) + endif() + +else() + # TODO: Copy macos shared libraries + message(FATAL_ERROR "CEF-CMake: Build platform not supported yet") +endif() diff --git a/cef_cmake/LICENSE.txt b/cef_cmake/LICENSE.txt new file mode 100644 index 0000000..b0eaa96 --- /dev/null +++ b/cef_cmake/LICENSE.txt @@ -0,0 +1,19 @@ +Copyright (c) 2019 Borislav Stanimirov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/cef_cmake/README.md b/cef_cmake/README.md new file mode 100644 index 0000000..ad5b8ae --- /dev/null +++ b/cef_cmake/README.md @@ -0,0 +1,48 @@ +# CEF-CMake + +CMake files for sane usage of [CEF (the Chromium Embedded Framework)](https://bitbucket.org/chromiumembedded/cef-project/overview). + +*This project is still a work in progress. Things will change quickly with no regard for backwards compatibility until this note is removed.* + +Note that this project is **not** applicable for building CEF itself, but only for using it as a library in another project. + +## Rationale + +The CEF project provide their own CMake files, but they have several outstanding issues: + +* They use old-style CMake (no `target_*` macros). +* They force the use of many potentially unwanted compiler settings (no exceptions, no RTTI, C++11) + +Hence projects which don't want to conform to any of this are forced to use their own solutions. + +**CEF-CMake** fixes this and provides a `CMakeLists.txt` file to make using CEF easy. + +## CEF-CMake features + +* Uses modern CMake +* Doesn't force any compiler settings except the minimum required: + * `/MT` instead of `/MTd` for Visual C when sandbox mode is enabled +* Provides the `cefdll_wrapper` static library target +* Downloads a CEF binary build from [Spotify's CEF automated builds](http://opensource.spotify.com/cefbuilds/index.html) +* Copies CEF binaries and resources next to target executables appropriately + +## Usage + +* You can have this project as a submodule of yours or somewhere in your directory tree. Doesn't matter. +* In your root `CMakeLists.txt` include `/cmake/cef_cmake.cmake`. +* Add this project's directory as a subdirectory. This defines the static library target `cefdll_wrapper` +* Add `cefdll_wrapper` to the link libraries of your CEF executables + +*Mac-specific instructions to come* + +## Example + +Another project of mine - [cef-demos](https://github.com/iboB/cef-demos) - includes this one as a submodule and provides some CEF demos, all using CEF-CMake. + +## License and copyright + +This software is distributed under the MIT Software License. + +See accompanying file LICENSE.txt or copy [here](https://opensource.org/licenses/MIT). + +Copyright © 2019 [Borislav Stanimirov](http://github.com/iboB) diff --git a/cef_cmake/cmake/cef_cmake.cmake b/cef_cmake/cmake/cef_cmake.cmake new file mode 100644 index 0000000..bdcfdc5 --- /dev/null +++ b/cef_cmake/cmake/cef_cmake.cmake @@ -0,0 +1,60 @@ +# CEF-CMake 1.0.0 +# Copyright (c) 2019 Borislav Stanimirov +# +# Distributed under the MIT Software License +# See accompanying file LICENSE.txt or copy at +# http://opensource.org/licenses/MIT +# +# Configuration file for CEF-CMake +# Include in your root CMakeLists.txt +# (or, stricly speaking, the root CMakeLists to all CEF-related projects) +set(CEF_CMAKE_INCLUDED YES) + +option(CEF_USE_SANDBOX "CEF-CMake: Enable or disable use of the CEF sandbox." ON) + +if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") + set(CEF_CMAKE_OS_MACOSX 1) + set(CEF_CMAKE_OS_POSIX 1) +elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") + set(CEF_CMAKE_OS_LINUX 1) + set(CEF_CMAKE_OS_POSIX 1) +elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") + set(CEF_CMAKE_OS_WINDOWS 1) +else() + message(FATAL_ERROR "CEF-CMake: Unsupported target platform") +endif() + +# Set a default build type if none was specified +# MSVC has no Default build type anyway, so skip this +if(NOT MSVC AND NOT CMAKE_BUILD_TYPE) + message(WARNING "CEF-CMake: 'Default' build type is not supported by CEF-CMake. Setting build type to 'Debug'.") + set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE) + # Set the possible values of build type for cmake-gui + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") +endif() + +if(MSVC AND CEF_USE_SANDBOX) + message(STATUS "CEF-CMake: Replacing /MD->/MT in C and CXX_FLAGS. Required by CEF sandbox.") + set(CompilerFlags + CMAKE_CXX_FLAGS + CMAKE_CXX_FLAGS_DEBUG + CMAKE_CXX_FLAGS_RELEASE + CMAKE_C_FLAGS + CMAKE_C_FLAGS_DEBUG + CMAKE_C_FLAGS_RELEASE + ) + foreach(CompilerFlag ${CompilerFlags}) + string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}") + endforeach() +endif() + +if(CEF_CMAKE_OS_WINDOWS) + set(CEF_CMAKE_EXECUTABLE_RESOURCES + ${CMAKE_CURRENT_LIST_DIR}/../res/win/cef.exe.manifest + ${CMAKE_CURRENT_LIST_DIR}/../res/win/compatibility.manifest + ) +elseif(CEF_CMAKE_OS_MACOSX) + message(FATAL_ERROR "CEF-CMake: Executable resources for platform not supported yet") +else() + set(CEF_CMAKE_EXECUTABLE_RESOURCES) +endif() diff --git a/cef_cmake/include/cef_cmake/disable_warnings.h b/cef_cmake/include/cef_cmake/disable_warnings.h new file mode 100644 index 0000000..d6c9947 --- /dev/null +++ b/cef_cmake/include/cef_cmake/disable_warnings.h @@ -0,0 +1,6 @@ +// intentionally no include guards +// users might want to include this file multiple times +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif diff --git a/cef_cmake/include/cef_cmake/reenable_warnings.h b/cef_cmake/include/cef_cmake/reenable_warnings.h new file mode 100644 index 0000000..b28940a --- /dev/null +++ b/cef_cmake/include/cef_cmake/reenable_warnings.h @@ -0,0 +1,5 @@ +// intentionally no include guards +// users might want to include this file multiple times +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif diff --git a/cef_cmake/res/win/cef.exe.manifest b/cef_cmake/res/win/cef.exe.manifest new file mode 100644 index 0000000..892f6fa --- /dev/null +++ b/cef_cmake/res/win/cef.exe.manifest @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/cef_cmake/res/win/compatibility.manifest b/cef_cmake/res/win/compatibility.manifest new file mode 100644 index 0000000..96639e7 --- /dev/null +++ b/cef_cmake/res/win/compatibility.manifest @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..9203cb5 --- /dev/null +++ b/main.cpp @@ -0,0 +1,30 @@ + +#include +#include + +class AyaCEFApp : public CefApp { + +public: + AyaCEFApp () {}; +private: + IMPLEMENT_REFCOUNTING(AyaCEFApp); + +}; + +class AyaSubProcess : public AyaCEFApp , public CefRenderProcessHandler { + +public: + virtual CefRefPtr GetRenderProcessHandler() override { + return this; + } + +private: + IMPLEMENT_REFCOUNTING(AyaSubProcess); + +}; + +int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nCmdShow) +{ + CefMainArgs args(hInstance); + return CefExecuteProcess(args, new AyaSubProcess(), nullptr); +} \ No newline at end of file