Skip to content

Commit 8f1fdc2

Browse files
committed
fix: assume available sandbox
1 parent aab32ce commit 8f1fdc2

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

native/CMakeLists.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,14 @@ if(OS_MAC)
294294
set(PRODUCT_NAME "${JCEF_APP_NAME}")
295295

296296
if(USE_SANDBOX)
297-
# Logical target used to link the cef_sandbox library.
298-
ADD_LOGICAL_TARGET("cef_sandbox_lib" "${CEF_SANDBOX_LIB_DEBUG}" "${CEF_SANDBOX_LIB_RELEASE}")
297+
# Some newer CEF distributions on macOS no longer ship a separate sandbox
298+
# static library. Only create/link the logical target if a path is provided.
299+
if((DEFINED CEF_SANDBOX_LIB_DEBUG AND CEF_SANDBOX_LIB_DEBUG) OR (DEFINED CEF_SANDBOX_LIB_RELEASE AND CEF_SANDBOX_LIB_RELEASE))
300+
ADD_LOGICAL_TARGET("cef_sandbox_lib" "${CEF_SANDBOX_LIB_DEBUG}" "${CEF_SANDBOX_LIB_RELEASE}")
301+
set(JCEF_HAS_CEF_SANDBOX_LIB TRUE)
302+
else()
303+
message(STATUS "CEF sandbox requested but no standalone sandbox library was found; assuming sandbox support is integrated in the CEF framework.")
304+
endif()
299305
endif()
300306

301307
# JCEF library target.
@@ -370,7 +376,9 @@ if(OS_MAC)
370376
)
371377

372378
if(USE_SANDBOX)
373-
target_link_libraries(${_helper_target} cef_sandbox_lib)
379+
if(TARGET cef_sandbox_lib)
380+
target_link_libraries(${_helper_target} cef_sandbox_lib)
381+
endif()
374382
endif()
375383

376384
# Add the Helper as a dependency of the main executable target.

0 commit comments

Comments
 (0)