Push everything and leave
This commit is contained in:
parent
62fa73c89f
commit
17950a153d
|
|
@ -9,3 +9,6 @@ install_manifest.txt
|
|||
compile_commands.json
|
||||
CTestTestfile.cmake
|
||||
_deps
|
||||
build/
|
||||
.vscode/
|
||||
.cache/
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
@ -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()
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# cef binary packages which are downloaded by cmake
|
||||
cef_binary_*
|
||||
|
|
@ -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()
|
||||
|
|
@ -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.
|
||||
|
|
@ -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 `<this_project_dir>/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)
|
||||
|
|
@ -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()
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
|
||||
<!--The compatibility section will be merged from compatibility.manifest -->
|
||||
|
||||
<dependency>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity type="Win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<security>
|
||||
<requestedPrivileges>
|
||||
<requestedExecutionLevel level="asInvoker" />
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
|
||||
</assembly>
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<!--The ID below indicates application support for Windows Vista -->
|
||||
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
|
||||
<!--The ID below indicates application support for Windows 7 -->
|
||||
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
|
||||
<!--The ID below indicates application support for Windows 8 -->
|
||||
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
|
||||
<!--The ID below indicates application support for Windows 8.1 -->
|
||||
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
|
||||
<!--
|
||||
The line below is explicitly commented out. Chromium works in mysterious ways which manifest (heh)
|
||||
in the following manner:
|
||||
When we add no compatiblity manifests to an application loading Chromium it disables the calling
|
||||
of some WinAPIs and runs in WindowsXP compatibility mode. This breaks multi-process mode.
|
||||
When Windows 10 is supported, and it runs on Windows 10, it enables some other WinAPIs in when
|
||||
rendering which break single-process mode. So in order to support both modes on Windows 10, we need
|
||||
to add a compatibility manifest to the exe, but explicitly leave out Windows 10 of the supported OS
|
||||
list.
|
||||
-->
|
||||
<!--The ID below indicates application support for Windows 10 -->
|
||||
<!-- <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/> -->
|
||||
</application>
|
||||
</compatibility>
|
||||
</assembly>
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
|
||||
#include <include/cef_base.h>
|
||||
#include <include/cef_app.h>
|
||||
|
||||
class AyaCEFApp : public CefApp {
|
||||
|
||||
public:
|
||||
AyaCEFApp () {};
|
||||
private:
|
||||
IMPLEMENT_REFCOUNTING(AyaCEFApp);
|
||||
|
||||
};
|
||||
|
||||
class AyaSubProcess : public AyaCEFApp , public CefRenderProcessHandler {
|
||||
|
||||
public:
|
||||
virtual CefRefPtr<CefRenderProcessHandler> 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);
|
||||
}
|
||||
Loading…
Reference in New Issue