Repository navigation
build(cmake): keep cmake/common host-neutral, move OS logic to cmake/<os> (#3234) - #3269
Merged
Merged
Conversation
Member
Author
|
Full ci.yml run (macOS + Windows app builds, required by BUILD.md for cmake/common changes) passed: https://github.com/obs-rust/obs-studio/actions/runs/41238476567 |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #3234, #3232
Platform-only CMake edits no longer have to touch
cmake/common/, whichci/ci_scope.pytreats as shared (it starts the macOS and Windows lanes).Moves
cmake/common/buildspec_common.cmake: macOS CEF per-arch slice foruniversal(#2994, #3016)cmake/macos/buildspec.cmake, as the_obs_dependency_platform_hookmacro. Common calls it only if it is defined. The cross lane does not define it (and it fetches no CEF).helpers_common.cmake:obs_msvc_exempt_c4201/c4505bodies (#2626)cmake/windows/helpers.cmake. Common keeps no-op defaults, because shared CMakeLists call these on every host. On other hosts the$<COMPILE_LANG_AND_ID:CXX,MSVC>genex already evaluated to nothing.helpers_common.cmake:add_core_moduleARCHITECTURES check (OS_WINDOWS/OS_MACOS)_obs_architecture_matches. The default (CMAKE_SYSTEM_PROCESSOR) is in common; the Windows (CMAKE_VS_PLATFORM_NAME) and macOS (CMAKE_OSX_ARCHITECTURES/ host processor) versions are in theirhelpers.cmakehelpers_common.cmake:target_exportif(OS_WINDOWS)package destinationOBS_CMAKE_PACKAGE_FLAT, set incmake/windows/helpers.cmakecpackconfig_common.cmake:if(OS_LINUX AND OBS_BRAND_RUST)package namecmake/linux/cpackconfig.cmakeEach OS
helpers.cmakeincludeshelpers_commonbefore it redefines anything, so the OS definition always wins.Tests
ci/test_cmake_common_os_neutral.pyfails with 11 hits (CMAKE_OSX_ARCHITECTURES,MSVCgenex,OS_WINDOWS,OS_MACOS,CMAKE_VS_PLATFORM_NAME,OS_LINUX). The allowlist isosconfig.cmake, which defines the OS vars, andsoldr.cmake, the cross lane (CROSS_SELF). A test fails if either allowlist entry stops being needed. The test also checks that the moved OS files select only their own OS lane.test_ci_scope,test_msvc_warning_level(now pointed atcmake/windows/helpers.cmake),test_cef_pin,test_cef_archive_rootandtest_deps_download_retry../lintpasses.cmake --preset ubuntu) on this host gets pasthelpers,cpackconfig(generatedCPACK_PACKAGE_NAME "obs-studio-rust") and the compiler config. It then stops atfind_package(ECM), because ECM is not installed on the host; that is unrelated to this change.Risks
macOS and Windows configure were not run locally. BUILD.md asks for a full
ci.ymlrun forcmake/common/changes before merge.