Update to C++20#517
Conversation
RytoEX
left a comment
There was a problem hiding this comment.
Super nit, but looks fine otherwise.
PatTheMav
left a comment
There was a problem hiding this comment.
I'm on board with increasing the language level to C++20, however that change should affect all targets (and not just the Linux ones).
obs-browser is not a "standalone module" (I removed CMake code to that end IIRC) and thus should always inherit what the main project sets up as (via CMAKE_CXX_STANDARD).
And moving the project to C++20 is indeed in the works already, so the issue will be solved automatically through that.
|
FWIW this patch is needed to build OBS with current CEF today. I'm not a CMake nor C++ expert, but building just the browser bits as C++20 (which is what this PR does) seems to work fine (and this patch is what Fedora is shipping). |
Current CEF requires compiling as C++20.
WizardCM
left a comment
There was a problem hiding this comment.
I can confirm updating obs-browser (or parent) is required for CEF 145+ compatibility, and that this PR on its own works correctly on Linux and Windows.
Approving with the understanding that this change could either be merged via this PR, or via a PR to the obs-studio repository itself (per Pat's comment)
|
This patch is also needed on macOS, but it misses the macOS helper targets. I hit this building #523 against CEF 147 on macOS arm64. Bumping The equivalent of the --- a/cmake/os-macos.cmake
+++ b/cmake/os-macos.cmake
target_compile_definitions(${target_name} PRIVATE ENABLE_BROWSER_SHARED_TEXTURE)
+
+ target_compile_features(${target_name} PRIVATE cxx_std_20)With that plus this PR's existing changes, obs-browser builds and runs on macOS against CEF 147 — browser sources render and Chrome Runtime initialises correctly. For context on why the helpers need explicit opt-in: obs-studio's C++20 groundwork has already landed (obsproject/obs-studio#12630 and obsproject/obs-studio#13320), but One question I can't answer from here: Environment
|
Description
Current CEF requires compiling as C++20.
Motivation and Context
Fails to build with CEF 145.
How Has This Been Tested?
Tested as local build, testing in Fedora shortly.
Types of changes
Checklist: