Skip to content

Add initial support for Windows ARM64#227

Open
anthony-linaro wants to merge 2 commits intoglikely:mainfrom
anthony-linaro:windows-arm64-support
Open

Add initial support for Windows ARM64#227
anthony-linaro wants to merge 2 commits intoglikely:mainfrom
anthony-linaro:windows-arm64-support

Conversation

@anthony-linaro
Copy link
Contributor

This PR adds support for building the plugin natively for Windows ARM64.

Had to switch buildspec to use my own fork, as the cmake in the main OBS tree blocks newer python. I suspect this is an oversight by OBS, as they have removed the limit elsewhere. For continuity, I would recommend pushing my changes to your own fork so that your code is not dependent on mine.

No CI as of yet, the scripts need a little bit of tweaking for the new GHA runners (lots of assumptions of Windows == x64).

Steps to test this is working:

  1. Open an x64 VS tools window, and run an x64 configure from in there: cmake --preset windows-x64
  2. Open an ARM64 VS tools window, and run an ARM64 configure from in there: cmake --preset windows-arm64
  3. Build the plugin: cmake --build --preset windows-arm64
  4. Install the plugin: cmake --install build_arm64 --prefix ./install --config RelWithDebInfo
  5. Copy to obs plugins directory

@anthony-linaro
Copy link
Contributor Author

Not entirely sure what's going on with macOS there, and I don't have a machine set up for it. It appears an empty list is being passed to add_dependencies somehow here: https://github.com/obsproject/obs-studio/blob/235be8ca3f8abcb99c4f44e9d9cea8ce9c736b99/cmake/macos/helpers.cmake#L89

@glikely
Copy link
Owner

glikely commented May 17, 2025

I found the problem. Cmake option ENABLE_UI was renamed to ENABLE_FRONTEND in upstream obs-studio obsproject/obs-studio@7db4a75, meaning that the frontend isn't getting disabled in the deps build. That seems to be fine on Windows and Linux, but it appears to break the macos build. I suspect macos is broken with ENABLE_FRONTEND=TRUE and ENABLE_PLUGINS=FALSE. Here is the fix:

diff --git a/cmake/common/buildspec_common.cmake b/cmake/common/buildspec_common.cmake
index e4a688b..b22504a 100644
--- a/cmake/common/buildspec_common.cmake
+++ b/cmake/common/buildspec_common.cmake
@@ -158,7 +158,7 @@ function(_setup_obs_studio)
     COMMAND
       "${CMAKE_COMMAND}" -S "${dependencies_dir}/${_obs_destination}" -B
       "${dependencies_dir}/${_obs_destination}/build_${arch}" -G ${_cmake_generator} "${_cmake_arch}"
-      -DOBS_CMAKE_VERSION:STRING=3.0.0 -DENABLE_PLUGINS:BOOL=OFF -DENABLE_UI:BOOL=OFF
+      -DOBS_CMAKE_VERSION:STRING=3.0.0 -DENABLE_PLUGINS:BOOL=OFF -DENABLE_FRONTEND:BOOL=OFF
       -DOBS_VERSION_OVERRIDE:STRING=${_obs_version} "-DCMAKE_PREFIX_PATH='${CMAKE_PREFIX_PATH}'" ${_is_fresh}
       ${_cmake_extra}
     RESULT_VARIABLE _process_result

@anthony-linaro anthony-linaro force-pushed the windows-arm64-support branch from e5f14bd to 3fb5320 Compare May 19, 2025 17:10
@anthony-linaro
Copy link
Contributor Author

I have reworked the commits and added your patch - hopefully the CI passes now!

@glikely
Copy link
Owner

glikely commented May 19, 2025

Thanks Anthony. I’ll take a look at the changes tomorrow.

You can squash the ENABLE_FRONTEND patch into the dependencies update patch. If it is kept separate then the series won’t build cleanly when bisecting

Copy link
Owner

@glikely glikely left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. There are a few small comments I've made, all pretty minor.

I won't be able to merge this into mainline yet because of the uprev to qt 6.8. Doing so will break running the plugin with OBS Studio 31.0.x because it is on qt 6.6 and the qtserialport dll will fail to load. If you send me a separate PR with just the first commit, then I can merge that into mainline and any further updates to this PR will automatically build instead of waiting for my approval each time.

These versions align with the current main branch of OBS

Signed-off-by: Anthony Roberts <anthony.roberts@linaro.org>
As x64 dependencies are currently also required for these builds due to
Qt being cross-compiled, an extra check is added, to ensure that an x64
configure has been done prior to trying to configure/build for ARM64.
As such, the deps folder in Windows now has the arch appended to it, so
that both can be present in the same folder.

`qtserialport` is disabled for this platform, as it had issues being
compiled. It is possible to work around it (it is also related to setting
QT_HOST_PATH), but needs a closer look at a later date.

Signed-off-by: Anthony Roberts <anthony.roberts@linaro.org>
@anthony-linaro anthony-linaro force-pushed the windows-arm64-support branch from cbb5421 to ba96bc8 Compare May 20, 2025 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants