Move compiler renaming to filter_compiler_wrappers (#41275)

This commit is contained in:
Dave Keeshan 2023-11-28 01:16:03 +00:00 committed by GitHub
parent ea610d3fe2
commit ed54359454
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -75,6 +75,10 @@ class Verilator(AutotoolsPackage):
depends_on("perl", type=("build", "run"))
depends_on("bash", type="build")
# we need to fix the CXX and LINK paths, as they point to the spack
# wrapper scripts which aren't usable without spack
filter_compiler_wrappers("verilated.mk", relative_root="include")
def setup_run_environment(self, env):
env.prepend_path("VERILATOR_ROOT", self.prefix)
@ -87,18 +91,3 @@ def autoreconf(self, spec, prefix):
def install_include(self):
install_tree("include", prefix.include)
install_tree("bin", prefix.bin)
# we need to fix the CXX and LINK paths, as they point to the spack
# wrapper scripts which aren't usable without spack
@run_after("install")
def patch_cxx(self):
filter_file(
r"^CXX\s*=.*",
f"CXX={self.compiler.cxx}",
join_path(self.prefix.include, "verilated.mk"),
)
filter_file(
r"^LINK\s*=.*",
f"LINK={self.compiler.cxx}",
join_path(self.prefix.include, "verilated.mk"),
)