diff --git a/modules/webbrowser/CMakeLists.txt b/modules/webbrowser/CMakeLists.txt index f311990365..2306cf462e 100644 --- a/modules/webbrowser/CMakeLists.txt +++ b/modules/webbrowser/CMakeLists.txt @@ -129,7 +129,9 @@ set(WEBBROWSER_SOURCES ${WEBBROWSER_SOURCES} ${WEBBROWSER_RESOURCES_SOURCES}) # CEF helper sources set(WEBBROWSER_HELPER_SOURCES src/webbrowserapp.cpp) -set(WEBBROWSER_HELPER_SOURCES_MACOSX src/processhelpermac.cpp) +if (OS_MACOSX) + list(APPEND WEBBROWSER_HELPER_SOURCES src/processhelpermac.cpp) +endif() set(WEBBROWSER_HELPER_SOURCES_WINDOWS src/processhelperwindows.cpp) APPEND_PLATFORM_SOURCES(WEBBROWSER_HELPER_SOURCES) @@ -152,30 +154,43 @@ set(WEBBROWSER_RESOURCES_SRCS # Place Helper in separate executable # The naming style " Helper" is required by Chromium. set(CEF_HELPER_TARGET "OpenSpace Helper" CACHE INTERNAL "CEF_HELPER_TARGET") +set(CEF_HELPER_TARGET_GPU "OpenSpace Helper (GPU)" CACHE INTERNAL "CEF_HELPER_TARGET_GPU") +set(CEF_HELPER_TARGET_RENDERER "OpenSpace Helper (Renderer)" CACHE INTERNAL "CEF_HELPER_TARGET_RENDERER") # # CEF platform-specific config # +list(APPEND Targets ${CEF_HELPER_TARGET} ${CEF_HELPER_TARGET_GPU} ${CEF_HELPER_TARGET_RENDERER}) + + if (OS_MACOSX) - # Helper executable target. - add_executable(${CEF_HELPER_TARGET} MACOSX_BUNDLE ${WEBBROWSER_HELPER_SOURCES}) - SET_EXECUTABLE_TARGET_PROPERTIES(${CEF_HELPER_TARGET}) - # add_cef_logical_target("libcef_lib" "${CEF_LIB_DEBUG}" "${CEF_LIB_RELEASE}") - add_dependencies(${CEF_HELPER_TARGET} libcef_dll_wrapper) - target_link_libraries(${CEF_HELPER_TARGET} libcef_dll_wrapper ${CEF_STANDARD_LIBS}) - set_target_properties(${CEF_HELPER_TARGET} PROPERTIES - MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/mac/helper-Info.plist - ) + ADD_LOGICAL_TARGET("cef_sandbox_lib" "${CEF_SANDBOX_LIB_DEBUG}" "${CEF_SANDBOX_LIB_RELEASE}") + foreach(target IN LISTS Targets) + # Helper executable target. + message(STATUS "set tar : ${target}") - target_compile_options(${CEF_HELPER_TARGET} PRIVATE -Wno-deprecated-declarations) - target_compile_options(libcef_dll_wrapper PRIVATE -Wno-deprecated-declarations) + add_executable(${target} MACOSX_BUNDLE ${WEBBROWSER_HELPER_SOURCES}) + SET_EXECUTABLE_TARGET_PROPERTIES(${target}) + # add_cef_logical_target("libcef_lib" "${CEF_LIB_DEBUG}" "${CEF_LIB_RELEASE}") + add_dependencies(${target} libcef_dll_wrapper) + target_link_libraries(${target} libcef_dll_wrapper ${CEF_STANDARD_LIBS}) + set_target_properties(${target} PROPERTIES + MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/mac/helper-Info.plist + ) + + target_compile_options(${target} PRIVATE -Wno-deprecated-declarations) + target_compile_options(libcef_dll_wrapper PRIVATE -Wno-deprecated-declarations) + + if (USE_SANDBOX) + # Logical target used to link the cef_sandbox library. + target_link_libraries(${target} cef_sandbox_lib) + endif () + endforeach() + +set_property(TARGET ${CEF_HELPER_TARGET_GPU} PROPERTY FOLDER "Helper") +set_property(TARGET ${CEF_HELPER_TARGET_RENDERER} PROPERTY FOLDER "Helper") - if (USE_SANDBOX) - # Logical target used to link the cef_sandbox library. - ADD_LOGICAL_TARGET("cef_sandbox_lib" "${CEF_SANDBOX_LIB_DEBUG}" "${CEF_SANDBOX_LIB_RELEASE}") - target_link_libraries(${CEF_HELPER_TARGET} cef_sandbox_lib) - endif () endif () if (OS_WINDOWS) diff --git a/modules/webbrowser/cmake/patch/cmake/cef_variables.cmake b/modules/webbrowser/cmake/patch/cmake/cef_variables.cmake index 82de3fb69c..449b226b5c 100644 --- a/modules/webbrowser/cmake/patch/cmake/cef_variables.cmake +++ b/modules/webbrowser/cmake/patch/cmake/cef_variables.cmake @@ -100,7 +100,7 @@ if(OS_LINUX) -fno-rtti # Disable real-time type information -fno-threadsafe-statics # Don't generate thread-safe statics -fvisibility-inlines-hidden # Give hidden visibility to inlined class member functions - -std=gnu++11 # Use the C++11 language standard including GNU extensions + -std=gnu++14 # Use the C++14 language standard including GNU extensions -Wsign-compare # Warn about mixed signed/unsigned type comparisons ) list(APPEND CEF_COMPILER_FLAGS_DEBUG @@ -259,7 +259,7 @@ if(OS_MACOSX) -fno-threadsafe-statics # Don't generate thread-safe statics -fobjc-call-cxx-cdtors # Call the constructor/destructor of C++ instance variables in ObjC objects -fvisibility-inlines-hidden # Give hidden visibility to inlined class member functions - -std=gnu++11 # Use the C++11 language standard including GNU extensions + -std=gnu++14 # Use the C++14 language standard including GNU extensions -Wno-narrowing # Don't warn about type narrowing -Wsign-compare # Warn about mixed signed/unsigned type comparisons ) diff --git a/modules/webbrowser/cmake/webbrowser_helpers.cmake b/modules/webbrowser/cmake/webbrowser_helpers.cmake index 8ae283eca1..e7bdf407ca 100644 --- a/modules/webbrowser/cmake/webbrowser_helpers.cmake +++ b/modules/webbrowser/cmake/webbrowser_helpers.cmake @@ -69,12 +69,16 @@ function(run_cef_macosx_config CEF_ROOT module_path) set(CEF_FINAL_APP "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CEF_OUTPUT_PREFIX}${CEF_TARGET}.app") set(CEF_INTERMEDIATE_HELPER_APP "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CEF_OUTPUT_PREFIX}${CEF_HELPER_TARGET}.app") + set(CEF_INTERMEDIATE_HELPER_APP_GPU "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CEF_OUTPUT_PREFIX}${CEF_HELPER_TARGET_GPU}.app") + set(CEF_INTERMEDIATE_HELPER_APP_RENDERER "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CEF_OUTPUT_PREFIX}${CEF_HELPER_TARGET_RENDERER}.app") set(CEF_FINAL_HELPER_APP "${CEF_FINAL_APP}/Contents/Frameworks/${CEF_HELPER_TARGET}.app") + set(CEF_FINAL_HELPER_APP_GPU "${CEF_FINAL_APP}/Contents/Frameworks/${CEF_HELPER_TARGET_GPU}.app") + set(CEF_FINAL_HELPER_APP_RENDERER "${CEF_FINAL_APP}/Contents/Frameworks/${CEF_HELPER_TARGET_RENDERER}.app") set(CEF_FRAMEWORK_LOCATION "${CEF_BINARY_DIR}/Chromium Embedded Framework.framework") set(CEF_FRAMEWORK_FINAL_LOCATION "${CEF_FINAL_APP}/Contents/Frameworks/Chromium Embedded Framework.framework") - add_dependencies(${CEF_TARGET} libcef_dll_wrapper "${CEF_HELPER_TARGET}") + add_dependencies(${CEF_TARGET} libcef_dll_wrapper "${CEF_HELPER_TARGET}" "${CEF_HELPER_TARGET_GPU}" "${CEF_HELPER_TARGET_RENDERER}") # target_link_libraries(${CEF_TARGET} PUBLIC libcef_lib libcef_dll_wrapper ${CEF_STANDARD_LIBS}) target_link_libraries(${CEF_TARGET} PUBLIC libcef_dll_wrapper ${CEF_STANDARD_LIBS}) @@ -89,6 +93,8 @@ function(run_cef_macosx_config CEF_ROOT module_path) POST_BUILD # Copy the helper app bundle into the Frameworks directory. COMMAND ${CMAKE_COMMAND} -E copy_directory "${CEF_INTERMEDIATE_HELPER_APP}" "${CEF_FINAL_HELPER_APP}" + COMMAND ${CMAKE_COMMAND} -E copy_directory "${CEF_INTERMEDIATE_HELPER_APP_GPU}" "${CEF_FINAL_HELPER_APP_GPU}" + COMMAND ${CMAKE_COMMAND} -E copy_directory "${CEF_INTERMEDIATE_HELPER_APP_RENDERER}" "${CEF_FINAL_HELPER_APP_RENDERER}" # Copy the CEF framework into the Frameworks directory. COMMAND ${CMAKE_COMMAND} -E copy_directory "${CEF_FRAMEWORK_LOCATION}" "${CEF_FRAMEWORK_FINAL_LOCATION}" VERBATIM diff --git a/modules/webbrowser/src/webbrowserapp.cpp b/modules/webbrowser/src/webbrowserapp.cpp index d0f7e7d044..af5dec9666 100644 --- a/modules/webbrowser/src/webbrowserapp.cpp +++ b/modules/webbrowser/src/webbrowserapp.cpp @@ -45,7 +45,7 @@ void WebBrowserApp::OnBeforeCommandLineProcessing(const CefString&, commandLine->AppendSwitch("use-gl=desktop"); commandLine->AppendSwitch("ignore-gpu-blacklist"); commandLine->AppendSwitch("log-gpu-control-list-decisions"); - + commandLine->AppendSwitch("use-mock-keychain"); commandLine->AppendSwitch("enable-begin-frame-scheduling"); commandLine->AppendSwitchWithValue("autoplay-policy", "no-user-gesture-required"); }