Skip to content

Commit 8064d86

Browse files
committed
feat: remove sandbox support for CEF 138+ on Windows
1 parent 9ff931f commit 8064d86

3 files changed

Lines changed: 37 additions & 36 deletions

File tree

cmake/SetupCef.cmake

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -103,26 +103,6 @@ if(${CMAKE_VERSION} GREATER "3.12")
103103
cmake_policy(SET CMP0077 NEW)
104104
endif()
105105

106-
if(OS_WINDOWS)
107-
add_link_options(/DEBUG)
108-
109-
if(USE_SANDBOX)
110-
# cef_sandbox.lib is MT already, must keep the same with it
111-
set(CEF_RUNTIME_LIBRARY_FLAG "/MT" CACHE STRING "Use static runtime")
112-
add_compile_options("/MT$<$<CONFIG:Debug>:d>")
113-
else()
114-
# either MT or MD is supported
115-
set(CEF_RUNTIME_LIBRARY_FLAG "/M$<IF:$<BOOL:${STATIC_CRT}>,T,D>" CACHE STRING "Use static runtime" FORCE)
116-
add_compile_options("/M$<IF:$<BOOL:${STATIC_CRT}>,T,D>$<$<CONFIG:Debug>:d>")
117-
endif()
118-
else()
119-
add_compile_options(
120-
"-g"
121-
"$<$<CONFIG:DEBUG>:-O0>"
122-
"$<$<CONFIG:RELEASE>:-O3>"
123-
)
124-
endif()
125-
126106
# Append CEF root dir to CMAKE_MODULE_PATH
127107
set(CEF_ROOT "${CEF_SDK_DIR}")
128108
list(APPEND CMAKE_MODULE_PATH "${CEF_ROOT}/cmake")
@@ -131,14 +111,6 @@ find_package(CEF REQUIRED)
131111
# Add libcef dll wrapper
132112
add_subdirectory(${CEF_LIBCEF_DLL_WRAPPER_PATH} libcef_dll_wrapper)
133113

134-
if(USE_SANDBOX AND(OS_WINDOWS OR OS_MACOS))
135-
add_definitions(-DCEF_USE_SANDBOX)
136-
137-
# message(STATUS "cef_sandbox_lib path:" "${CEF_SANDBOX_LIB_DEBUG}," "${CEF_SANDBOX_LIB_RELEASE}" )
138-
# Logical target used to link the cef_sandbox library.
139-
ADD_LOGICAL_TARGET("cef_sandbox_lib" "${CEF_SANDBOX_LIB_DEBUG}" "${CEF_SANDBOX_LIB_RELEASE}")
140-
endif()
141-
142114
PRINT_CEF_CONFIG()
143115

144116
# #################################################################################
@@ -189,3 +161,32 @@ if(${Need_Config_CefVersion_File})
189161
else()
190162
message(STATUS "No need to configure CefVersion.h file")
191163
endif()
164+
165+
# config CEF sandbox
166+
if(USE_SANDBOX AND(OS_MACOS OR(OS_WINDOWS AND(CEF_VERSION_MAJOR LESS 138))))
167+
add_definitions(-DCEF_USE_SANDBOX)
168+
message(STATUS "cef_sandbox_lib path:" "${CEF_SANDBOX_LIB_DEBUG}," "${CEF_SANDBOX_LIB_RELEASE}")
169+
170+
# Logical target used to link the cef_sandbox library.
171+
ADD_LOGICAL_TARGET("cef_sandbox_lib" "${CEF_SANDBOX_LIB_DEBUG}" "${CEF_SANDBOX_LIB_RELEASE}")
172+
endif()
173+
174+
if(OS_WINDOWS)
175+
add_link_options(/DEBUG)
176+
177+
if(USE_SANDBOX AND(CEF_VERSION_MAJOR LESS 138))
178+
# cef_sandbox.lib is MT already, must keep the same with it
179+
set(CEF_RUNTIME_LIBRARY_FLAG "/MT" CACHE STRING "Use static runtime")
180+
add_compile_options("/MT$<$<CONFIG:Debug>:d>")
181+
else()
182+
# either MT or MD is supported
183+
set(CEF_RUNTIME_LIBRARY_FLAG "/M$<IF:$<BOOL:${STATIC_CRT}>,T,D>" CACHE STRING "Use static runtime" FORCE)
184+
add_compile_options("/M$<IF:$<BOOL:${STATIC_CRT}>,T,D>$<$<CONFIG:Debug>:d>")
185+
endif()
186+
else()
187+
add_compile_options(
188+
"-g"
189+
"$<$<CONFIG:DEBUG>:-O0>"
190+
"$<$<CONFIG:RELEASE>:-O3>"
191+
)
192+
endif()

include/CefVersion.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
#pragma once
1414

1515
// clang-format off
16-
#define CEF_VERSION "127.3.5+g114ea2a+chromium-127.0.6533.120"
17-
#define CEF_VERSION_MAJOR 127
18-
#define CEF_VERSION_MINOR 3
19-
#define CEF_VERSION_PATCH 5
20-
#define CEF_COMMIT_NUMBER 3037
21-
#define CEF_COMMIT_HASH "114ea2af1ba9da18c4ac5e599ccdbb17d01ba75a"
16+
#define CEF_VERSION "142.0.15+g6dfdb28+chromium-142.0.7444.176"
17+
#define CEF_VERSION_MAJOR 142
18+
#define CEF_VERSION_MINOR 0
19+
#define CEF_VERSION_PATCH 15
20+
#define CEF_COMMIT_NUMBER 3314
21+
#define CEF_COMMIT_HASH "6dfdb28d752a47e189d7a23b01f368ab0bdb378d"
2222
// clang-format on
2323

2424
#endif // CefVersion

src/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ if(OS_WINDOWS)
7070
${CEF_STANDARD_LIBS}
7171
)
7272

73-
if(USE_SANDBOX)
73+
if(USE_SANDBOX AND(CEF_VERSION_MAJOR LESS 138))
7474
list(APPEND CefViewCore_LIBS cef_sandbox_lib)
7575
endif()
7676

@@ -230,7 +230,7 @@ if(OS_WINDOWS)
230230
${CEF_SANDBOX_STANDARD_LIBS}
231231
)
232232

233-
if(USE_SANDBOX AND CEF_VERSION_MAJOR LESS 138)
233+
if(USE_SANDBOX AND(CEF_VERSION_MAJOR LESS 138))
234234
list(APPEND _helper_libs cef_sandbox_lib)
235235
endif()
236236

0 commit comments

Comments
 (0)