openfoam: restrict the CGAL version compatible with C++14 (#47689)

* openfoam: restrict the CGAL version compatible with C++14

CGAL throws an
[error](50219fc33b/Installation/include/CGAL/config.h (L147))
if C++ lower than 17 is used, while OpenFOAM [forces
C++14](https://develop.openfoam.com/Development/openfoam/-/blob/develop/wmake/rules/General/Gcc/c++?ref_type=heads#L9).
This hard C++17 dependency was
[introduced](e54408370b)
to CGAL version 6.

* Add upper bound since openfoam now uses c++17

44f7a7268a
This commit is contained in:
Stephen Sachs 2025-03-21 16:23:33 +01:00 committed by GitHub
parent ee6ea5155c
commit 6e10fac7ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -373,7 +373,8 @@ class Openfoam(Package):
# Earlier versions of OpenFOAM may not work with CGAL 5.6. I do
# not know which OpenFOAM added support for 5.x and conservatively
# use 2312 in the check.
depends_on("cgal", when="@2312:")
# cgal@6 needs c++17, but OpenFOAM forces c++14
depends_on("cgal@:5", when="@2312:2412")
depends_on("cgal@:4", when="@:2306")
# The flex restriction is ONLY to deal with a spec resolution clash