libunistring: 1.2 needs std=c18 for icc, add icc C++ flags update (#37607)

This commit is contained in:
Stephen Sachs 2024-10-11 02:25:32 +02:00 committed by GitHub
parent 7df23c7471
commit 22043617aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 17 additions and 0 deletions

View File

@ -92,6 +92,14 @@ def c11_flag(self):
else:
return "-std=c1x"
@property
def c18_flag(self):
# c18 supported since oneapi 2022, which is classic version 2021.5.0
if self.real_version < Version("21.5.0"):
raise UnsupportedCompilerFlag(self, "the C18 standard", "c18_flag", "< 21.5.0")
else:
return "-std=c18"
@property
def cc_pic_flag(self):
return "-fPIC"

View File

@ -461,9 +461,13 @@ def test_intel_flags():
unsupported_flag_test("cxx14_flag", "intel@=14.0")
supported_flag_test("cxx14_flag", "-std=c++1y", "intel@=15.0")
supported_flag_test("cxx14_flag", "-std=c++14", "intel@=15.0.2")
unsupported_flag_test("cxx17_flag", "intel@=18")
supported_flag_test("cxx17_flag", "-std=c++17", "intel@=19.0")
unsupported_flag_test("c99_flag", "intel@=11.0")
supported_flag_test("c99_flag", "-std=c99", "intel@=12.0")
unsupported_flag_test("c11_flag", "intel@=15.0")
supported_flag_test("c18_flag", "-std=c18", "intel@=21.5.0")
unsupported_flag_test("c18_flag", "intel@=21.4.0")
supported_flag_test("c11_flag", "-std=c1x", "intel@=16.0")
supported_flag_test("cc_pic_flag", "-fPIC", "intel@=1.0")
supported_flag_test("cxx_pic_flag", "-fPIC", "intel@=1.0")

View File

@ -46,6 +46,11 @@ def patch(self):
# https://bugs.gentoo.org/688464#c9 (this links to all further info)
filter_file("# pragma weak pthread_create", "", "tests/glthread/thread.h")
def flag_handler(self, name, flags):
if name == "cflags" and self.spec.satisfies("@1.1:") and self.spec.satisfies("%intel"):
flags.append(self.compiler.c18_flag)
return (flags, None, None)
@when("@master")
def autoreconf(self, spec, prefix):
which("./gitsub.sh")("pull")