Open diegoiast opened 5 months ago
Could std::chrono be used as a replacement for the POSIX-only sys/time.h, as it's present in the C++ 20 standard?
We have a patch hiding in one of those mentioned branches to make AK::Time and AK::Duration work well on windows, so that's not an issue at the moment.
[[no_unique_address]] not supported (am I using a wrong compiler? I use MSVC 2022 and its clang-cl)
A separate msvc::no_unique_address
attribute must currently be used instead for ABI reasons: https://devblogs.microsoft.com/cppblog/msvc-cpp20-and-the-std-cpp20-switch/#msvc-extensions-and-abi
This is true in clang-cl too, using a recent-enough version: https://github.com/llvm/llvm-project/pull/65675
Why find an alternative to fontconfig? It works on windows and even compiles with clang-cl. It needs to have config files shipped for it as windows doesn't provide any. It is used in GIMP for example.
Have anyone tried to build Ladybird in Cygwin/MSYS2? They provide some POSIX compatibility layer for Windows.
As stated in the first post of the issue, Cygwin and Mingw are not a goal. Native windows with clang-cl and wsl2 with wslg are the only two windows configurations we will support in this repository.
Maybe a github discussions tab, or other way of collaboration could be opened to avoid spamming this tracking issue. This will need more work. (Also how to get cmake to find ICU data?)
@R-Goc I'm currently trying to prepare a native windows build, I've downloaded the icu4c library and have added an environment variable ICU_ROOT
to point to the root folder of the ICU lib (where include, lib folders are located). This should be enough for CMake to find it.
Currently "stuck" on PkgConfig
and JPEG.
pkgconfig looks like is only needed as a build tool so I guess the version distributed with MinGW (like in w64devkit) should work. How did you deal with skia?
Hi all,
This is not the place for such discussions. The project has a discord channel. Use that instead of this issue.
@diegoiast I have got the checks of 2 and 3 working in this pr if or when it is merged(✅) Platform Windows: Get CMake working to build Windows-native build #1695](https://github.com/LadybirdBrowser/ladybird/pull/1695) vcpkg can build font-config and other library's except FFMPEG this is disabled for this config. the PR sets up CMake to be able to construct the browser with ClangCL but was Working with MSVC first.
This is a meta issue to track all the issues needed for a Windows support.
Goals:
- We aim to support clang-cl. This is the first priority.
- Later on, cl, from 2022. This is a very low priority.
- If we manage to get some mingw toolchain to compile the program - I am happy. But this is not a goal.
Problems:
- [x] ~Some compiler flags are not compatible with clang-cl.~ (Meta/Windows: fix compilation flags for clang-cl #77)
- [ ] We need a package manager to handle building 3rd parties (ICU, fontconfig?, Skia, WABT, more?)
- [ ] We need to find an alternative to fontconfig.
- [ ] 'sys/time.h' not found
- [ ]
[[no_unique_address]]
not supported (am I using a wrong compiler? I use MSVC 2022 and its clang-cl)- [ ] We need to pull code from previous attempts of this kind of work. (cherry-picks, rebase etc).
- [ ] Need to understand how to run the commit linters on the local machine, as we don't want developers to spam the CI/CD with phantom builds, just to fix a typo on the commit log (yes, that is directed at me)
Known forks, branches:
- https://github.com/cammo1123/serenity/tree/WindowsJS2.0
- https://github.com/abuneri/serenity/tree/windows-ladybird
Please do not comment on this issue unless you have something to contribute. This issue is one of the boss-issues - it will take time. Problems and goals will change, nothing is written in stone, provide code if you can.
updated list
- [x] ~Some compiler flags are not compatible with clang-cl.~ (Meta/Windows: fix compilation flags for clang-cl #77)
- [X] We need a package manager to handle building 3rd parties (ICU, fontconfig?, Skia, WABT, more?)
- [X] We need to find an alternative to fontconfig.
- [ ] 'sys/time.h' not found
- [ ]
[[no_unique_address]]
not supported (am I using a wrong compiler? I use MSVC 2022 and its clang-cl)- [ ] We need to pull code from previous attempts of this kind of work. (cherry-picks, rebase etc).
- [ ] Need to understand how to run the commit linters on the local machine, as we don't want developers to spam the CI/CD with phantom builds, just to fix a typo on the commit log (yes, that is directed at me)
[[no_unique_address]] is a known thing. In short because of compatibility it is a noop. On msvc and clang-cl which attempts to match cl, you need to use [[msvc::no_unique_address]]. See https://github.com/llvm/llvm-project/issues/49358 for reference. So to support it, realistically you need to do it C style with a macro that replaces the attribute depending on the compiler. Maybe some time in the future when MSVC decides to break ABI again this would be changed, but no clue when or even if that would happen.
This is a meta issue to track all the issues needed for a Windows support.
Goals:
Problems:
Some compiler flags are not compatible with clang-cl.(https://github.com/LadybirdBrowser/ladybird/pull/77)[[no_unique_address]]
not supported (am I using a wrong compiler? I use MSVC 2022 and its clang-cl)Known forks, branches:
Please do not comment on this issue unless you have something to contribute. This issue is one of the boss-issues - it will take time. Problems and goals will change, nothing is written in stone, provide code if you can.