Adds a compiler minimum version check. If failed, it returns a fatal error. This early stop at configure time will avoid contributors losing time trying to fix compilation errors because of not fitting the requirements.
Example of the output for GCC: Version requirement satisfied:
0sliv3r@sliv3r-tuxedo:~/Documentos/Projectes/BitcoinCore/bitcoin$ cmake -B BUILD
1-- The CXX compiler identification is GNU 13.3.0
2-- Detecting CXX compiler ABI info
3-- Detecting CXX compiler ABI info - done
4....
Version requirement not satisfied:
0$ cmake -B build -S . -DCMAKE_C_COMPILER=/usr/bin/gcc-11 -DCMAKE_CXX_COMPILER=/usr/bin/g++-11
1-- The CXX compiler identification is GNU 11.5.0
2-- Detecting CXX compiler ABI info
3-- Detecting CXX compiler ABI info - done
4-- Check for working CXX compiler: /usr/bin/g++-11 - skipped
5-- Detecting CXX compile features
6-- Detecting CXX compile features - done
7CMake Error at CMakeLists.txt:91 (message):
8 GCC >= 12.1 required.
9
10
11-- Configuring incomplete, errors occurred!
Example of the output for Clang: Version requirement satisfied:
0sliv3r@sliv3r-tuxedo:~/Documentos/Projectes/BitcoinCore/bitcoin$ cmake -B build
1-- The CXX compiler identification is Clang 18.1.3
2-- Detecting CXX compiler ABI info
3-- Detecting CXX compiler ABI info - done
4...
Version requirement not satisfied:
0$ cmake -B build -DCMAKE_C_COMPILER=clang-16 -DCMAKE_CXX_COMPILER=clang++-16
1-- The CXX compiler identification is Clang 16.0.6
2-- Detecting CXX compiler ABI info
3-- Detecting CXX compiler ABI info - done
4-- Check for working CXX compiler: /usr/bin/clang++-16 - skipped
5-- Detecting CXX compile features
6-- Detecting CXX compile features - done
7CMake Error at CMakeLists.txt:86 (message):
8 Clang >= 17.0 required.
9
10
11-- Configuring incomplete, errors occurred!