From 9e0629213cb4b43a2c333c044fc964c98000d899 Mon Sep 17 00:00:00 2001 From: Aiden Grossman <39388941+boomanaiden154@users.noreply.github.com> Date: Thu, 27 Jul 2023 10:58:21 -0700 Subject: [PATCH] lm-sensors: respect compiler choice (#38890) Currently lm-sensors defaults to the compiler specified in the Makefile (gcc) rather than the one specified in the spec. This patch appends the CC flag to the make invocation with the spec compiler to fix this behavior. --- var/spack/repos/builtin/packages/lm-sensors/package.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/var/spack/repos/builtin/packages/lm-sensors/package.py b/var/spack/repos/builtin/packages/lm-sensors/package.py index 31780f155fa..9f4fe23a6a6 100644 --- a/var/spack/repos/builtin/packages/lm-sensors/package.py +++ b/var/spack/repos/builtin/packages/lm-sensors/package.py @@ -31,6 +31,14 @@ class LmSensors(MakefilePackage): depends_on("flex", type="build") depends_on("perl", type="run") + @property + def build_targets(self): + targets = [] + + targets.append("CC={0}".format(spack_cc)) + + return targets + def install(self, spec, prefix): make("install", "PREFIX={0}".format(prefix), "ETCDIR={0}/etc".format(prefix))