LadybirdBrowser / ladybird

Truly independent web browser
https://ladybird.org
BSD 2-Clause "Simplified" License
19.67k stars 807 forks source link

CMake Error: Unrecognized "version" field #980

Open geajack opened 1 month ago

geajack commented 1 month ago

When I try to build following the instructions, upon running

./Meta/ladybird.sh run ladybird

I get

CMake Error: Could not read presets from /home/jack/Code/Ladybird/Codebase: Unrecognized "version" field

The only other command I ran to set the project up before running the shell script was what's shown in the guide:

sudo apt install autoconf autoconf-archive automake build-essential ccache cmake curl fonts-liberation2 git libavcodec-dev libgl1-mesa-dev nasm ninja-build pkg-config qt6-base-dev qt6-tools-dev-tools qt6-wayland tar unzip zip

Ubuntu 22.04

ADKaster commented 1 month ago

CMake must be at least version 3.25. if your Cmake cannot read the CMakePresets.json, that's because it is too old.

https://github.com/LadybirdBrowser/ladybird/blob/master/Documentation/BuildInstructionsLadybird.md#cmake-325-or-newer

sergio-eld commented 1 month ago

maybe makes sense to add FATAL_ERROR for the required version in the start of CMakeLists.txt then? Would prevent such errors

geajack commented 1 month ago

I should have re-read the prereqs more carefully. But a more explicit error message would be cool

ADKaster commented 1 month ago

This error occurs when CMake reads the CMakePresets.json, which is before it reads CMakeLists.txt. We do have a required version check in the top CMakeLists.txt, but it won't help with this specific issue. We would need a duplicate version check in the ladybird.sh script to catch a version too old to parse the CMakePresets.json

Laura-Braun commented 1 month ago

Sorry I didn't know how to fix that. so just created new PR.