summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/spack/spack/bootstrap/_common.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/spack/spack/bootstrap/_common.py b/lib/spack/spack/bootstrap/_common.py
index 5c3ca93e94..2afc6ea17c 100644
--- a/lib/spack/spack/bootstrap/_common.py
+++ b/lib/spack/spack/bootstrap/_common.py
@@ -213,15 +213,18 @@ def _root_spec(spec_str: str) -> str:
Args:
spec_str: spec to be bootstrapped. Must be without compiler and target.
"""
- # Add a compiler requirement to the root spec.
+ # Add a compiler and platform requirement to the root spec.
platform = str(spack.platforms.host())
+
if platform == "darwin":
spec_str += " %apple-clang"
+ elif platform == "windows":
+ spec_str += " %msvc"
elif platform == "linux":
spec_str += " %gcc"
elif platform == "freebsd":
spec_str += " %clang"
-
+ spec_str += f" platform={platform}"
target = archspec.cpu.host().family
spec_str += f" target={target}"