yaml_cpp: do not import spack.spec (#50382)

This commit is contained in:
Harmen Stoppels 2025-05-08 18:52:35 +02:00 committed by GitHub
parent b0b316c646
commit cd75e52ba2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,7 +3,6 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import * from spack.package import *
from spack.spec import ConflictsInSpecError
from ..boost.package import Boost from ..boost.package import Boost
@ -57,20 +56,12 @@ def flag_handler(self, name, flags):
# the user can add arbitrary strings to the flags. Here we can at least # the user can add arbitrary strings to the flags. Here we can at least
# fail early. # fail early.
# We'll include cppflags in case users mistakenly put c++ flags there. # We'll include cppflags in case users mistakenly put c++ flags there.
spec = self.spec if (
if name in ("cxxflags", "cppflags") and spec.satisfies("+tests"): name in ("cxxflags", "cppflags")
if "-stdlib=libc++" in flags: and self.spec.satisfies("+tests")
raise ConflictsInSpecError( and "-stdlib=libc++" in flags
spec, ):
[ raise InstallError(yaml_cpp_tests_libcxx_error_msg)
(
spec,
spec.compiler_flags[name],
spec.variants["tests"],
yaml_cpp_tests_libcxx_error_msg,
)
],
)
return (flags, None, None) return (flags, None, None)
def cmake_args(self): def cmake_args(self):