Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for building for Windows ARM64 #670

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

ddscentral
Copy link

This PR adds support for building libcec for Windows ARM64.

Please also check out the relevant PRs for "platform" and "support" submodules.

Pulse-Eight/platform#50
Pulse-Eight/libcec-support#4

@garbear
Copy link

garbear commented Jan 16, 2025

I went through all commits of all 3 PRs, and it looks like the port was done correctly. I saw no surprises.

I haven't compiled tested yet, will try to do so once I get my Windows system backup and running.

@anthony-linaro
Copy link

anthony-linaro commented Jan 17, 2025

Is libcecsharp included in this too, or is the intention to build without it (or did I clone something wrong?)

I cloned this repo recursively, and use the build command:
windows\build-all.cmd arm64

It then appears to try and build the x64 version of libcecsharp, on my WoA machine

@ddscentral
Copy link
Author

ddscentral commented Jan 17, 2025

It isn't, unfortunately.
I have attempted to get it built (https://github.com/ddscentral/cec-dotnet-win-arm64) as well but there's no compatible .NET SDK for ARM64 which would work.

@anthony-linaro
Copy link

No compatible one, as in the ones that support it are too new compared to the one the project requires?

Is there a command line I should be using for building/testing then, that doesn't build libcecsharp?

@ddscentral
Copy link
Author

ddscentral commented Jan 17, 2025

Added a fix to build-all.cmd to disable building of .NET binaries on ARM64.

I did try to build .NET libs, but could not get anything to build.
LibCecSharp targets .NET 4.0 and Windows 8.1 SDK. While .NET supports ARM64 (version 4.8.1), Windows 8.1 SDK does not.
LibCecSharpCore requires .NET Core 3.1 SDK which isn't available for ARM64

EDIT: updated the .NET fix to avoid breakage for x86.

@ddscentral
Copy link
Author

ddscentral commented Jan 20, 2025

Had another look and .NET issue. If retargeting SDK version would be an option, switching LibCecSharp to Windows 10 SDK would allow to build the .NET library and applications for ARM64.
Not sure if anything can be done to the .NET Core lib and the test app without updating the target framework as the target version simply does not exist for ARM64.

@anthony-linaro
Copy link

I suspect that is something that would need to be answered by the maintainers - IMO moving to the Windows 10 SDK is not unreasonable, it's been around for a while now. How would that impact building for Linux/macOS (if libcecsharp is built for those platforms at all?)

C#/.NET components aside, I gave building this a go - there was a single error at the end of the same command I specified previously, with the last 2 lines of the log being:

 * libCEC for arm64 built successfully
The system cannot find the path specified.

Is the install step still trying to look for libcecsharp somewhere?

That aside, it appears to build correctly, but I had no way of testing anything - I don't own one of the pulse-eight USB adapters, which AFAICT is the only way to test this on a Windows machine - the HDMI port on my Thinkpad T14s Gen6 certainly doesn't seem to advertise CEC support.

@ddscentral
Copy link
Author

ddscentral commented Jan 21, 2025

Thanks for your review. Does that error come from build-all.cmd ? I will have a look, I may have forgotten something.
CMakeLists.txt includes .NET libs/apps only for Windows builds.

I also don't own anything from Pulse Eight nor have any compatible Windows ARM64 hardware to test. My Surface Pro 11 5G does not have any HDMI ports, only DisplayPort over Type-C.
I would need Pulse Eight USB adapter to test.

As for .NET support for ARM64, we need a word from maintainers.
I do have all the changes to the .NET repo on Github and also some uncommitted changes which I can commit right away if needed.
The .NET apps seem to run but again can't test without compatible hardware.

@anthony-linaro
Copy link

anthony-linaro commented Jan 23, 2025

Does that error come from build-all.cmd?

Yes it does, I just recursively cloned your repo, and did a windows\build-all.cmd arm64 - that was the last line

I would need Pulse Eight USB adapter to test.

I guess at this point we need to find someone who has both the pulse-eight hardware and one of these machines then (maybe a mac running parallels would possibly work too?)

For the rest, I suspect we now need a miantainer to weigh in and give their opinions on the .NET situation

@ddscentral
Copy link
Author

Ok, I'll take a look at the script later this day.

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.

3 participants