summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeth R. Johnson <johnsonsr@ornl.gov>2022-02-10 08:43:22 -0500
committerGitHub <noreply@github.com>2022-02-10 13:43:22 +0000
commit92b26257f47039b9431acd76e35766cf08443ab9 (patch)
tree2dccbbfbbbf489ee1bf36083777b10653921d4d7
parentfa38af285cc58bf0c4cfec00badfac9db113a9c9 (diff)
downloadspack-92b26257f47039b9431acd76e35766cf08443ab9.tar.gz
spack-92b26257f47039b9431acd76e35766cf08443ab9.tar.bz2
spack-92b26257f47039b9431acd76e35766cf08443ab9.tar.xz
spack-92b26257f47039b9431acd76e35766cf08443ab9.zip
Fix CMakePackage.define for libs/headers (#28838)
The 'libs' property returned by a spec is not a list nor tuple. Closes #28836.
-rw-r--r--lib/spack/spack/build_systems/cmake.py5
-rw-r--r--lib/spack/spack/test/build_systems.py3
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/spack/spack/build_systems/cmake.py b/lib/spack/spack/build_systems/cmake.py
index d82bb245fe..4ef798fd51 100644
--- a/lib/spack/spack/build_systems/cmake.py
+++ b/lib/spack/spack/build_systems/cmake.py
@@ -10,6 +10,9 @@ import platform
import re
from typing import List # novm
+import six
+
+from llnl.util.compat import Sequence
from llnl.util.filesystem import working_dir
import spack.build_environment
@@ -222,7 +225,7 @@ class CMakePackage(PackageBase):
value = "ON" if value else "OFF"
else:
kind = 'STRING'
- if isinstance(value, (list, tuple)):
+ if isinstance(value, Sequence) and not isinstance(value, six.string_types):
value = ";".join(str(v) for v in value)
else:
value = str(value)
diff --git a/lib/spack/spack/test/build_systems.py b/lib/spack/spack/test/build_systems.py
index da8021db68..733381e8f2 100644
--- a/lib/spack/spack/test/build_systems.py
+++ b/lib/spack/spack/test/build_systems.py
@@ -313,6 +313,9 @@ class TestCMakePackage(object):
arg = pkg.define('MULTI', cls(['right', 'up']))
assert arg == '-DMULTI:STRING=right;up'
+ arg = pkg.define('MULTI', fs.FileList(['/foo', '/bar']))
+ assert arg == '-DMULTI:STRING=/foo;/bar'
+
arg = pkg.define('ENABLE_TRUTH', False)
assert arg == '-DENABLE_TRUTH:BOOL=OFF'
arg = pkg.define('ENABLE_TRUTH', True)