Use a stub compiler wrapper on windows
This commit is contained in:
parent
95115d4290
commit
4bd9ff2ef0
File diff suppressed because one or more lines are too long
@ -1506,7 +1506,7 @@ def __init__(self, tests: bool = False):
|
||||
set
|
||||
)
|
||||
|
||||
self.possible_compilers: List[KnownCompiler] = []
|
||||
self.possible_compilers: List[spack.spec.Spec] = []
|
||||
self.possible_oses: Set = set()
|
||||
self.variant_values_from_specs: Set = set()
|
||||
self.version_constraints: Set = set()
|
||||
@ -3151,7 +3151,6 @@ def define_runtime_constraints(self):
|
||||
|
||||
# FIXME (compiler as nodes): think of using isinstance(compiler_cls, WrappedCompiler)
|
||||
# Add a dependency on the compiler wrapper
|
||||
if sys.platform != "win32":
|
||||
recorder("*").depends_on(
|
||||
"compiler-wrapper",
|
||||
when=f"%{compiler.name}@{compiler.versions}",
|
||||
|
@ -3,6 +3,7 @@
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
import pathlib
|
||||
import shutil
|
||||
import sys
|
||||
from typing import List
|
||||
|
||||
import archspec.cpu
|
||||
@ -39,13 +40,15 @@ class CompilerWrapper(Package):
|
||||
|
||||
license("Apache-2.0 OR MIT")
|
||||
|
||||
if sys.platform != "win32":
|
||||
version(
|
||||
"1.0",
|
||||
sha256="92924570efbc0f388bbbeb87188e05537008bc25069529f7b519b4e48d7ddfb6",
|
||||
sha256="84a26f8f37329bcdfb41d23a8a4f4c46efbede983eb73737135c95a4c126b5b7",
|
||||
expand=False,
|
||||
)
|
||||
|
||||
conflicts("platform=windows")
|
||||
else:
|
||||
version("1.0")
|
||||
has_code = False
|
||||
|
||||
def bin_dir(self) -> pathlib.Path:
|
||||
# This adds an extra "spack" subdir, so that the script and symlinks don't get
|
||||
@ -53,6 +56,14 @@ def bin_dir(self) -> pathlib.Path:
|
||||
return pathlib.Path(str(self.prefix)) / "spack" / "bin"
|
||||
|
||||
def install(self, spec, prefix):
|
||||
if sys.platform == "win32":
|
||||
placeholder = self.bin_dir() / "placeholder-wrapper"
|
||||
placeholder.parent.mkdir(parents=True)
|
||||
placeholder.write_text(
|
||||
"This file is a placeholder for the compiler wrapper on Windows."
|
||||
)
|
||||
return
|
||||
|
||||
cc_script = pathlib.Path(self.stage.source_path) / "cc.sh"
|
||||
bin_dir = self.bin_dir()
|
||||
|
||||
@ -125,6 +136,9 @@ def install(self, spec, prefix):
|
||||
(bin_dir / subdir / name).symlink_to(installed_script)
|
||||
|
||||
def setup_dependent_build_environment(self, env, dependent_spec):
|
||||
if sys.platform == "win32":
|
||||
return
|
||||
|
||||
_var_list = []
|
||||
if dependent_spec.dependencies(virtuals=("c",)):
|
||||
_var_list.append(("c", "cc", "CC", "SPACK_CC"))
|
||||
|
Loading…
Reference in New Issue
Block a user