summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/cmake/package.py17
-rw-r--r--var/spack/repos/builtin/packages/ninja-fortran/package.py9
-rw-r--r--var/spack/repos/builtin/packages/ninja/package.py1
3 files changed, 22 insertions, 5 deletions
diff --git a/var/spack/repos/builtin/packages/cmake/package.py b/var/spack/repos/builtin/packages/cmake/package.py
index e988af5ba2..0ce352b9ab 100644
--- a/var/spack/repos/builtin/packages/cmake/package.py
+++ b/var/spack/repos/builtin/packages/cmake/package.py
@@ -307,11 +307,20 @@ class Cmake(Package):
args = []
self.generator = make
+ if self.spec.satisfies("platform=windows"):
+ args.append("-GNinja")
+ self.generator = ninja
+
if not sys.platform == "win32":
args.append("--prefix={0}".format(self.prefix))
- if spack.build_environment.should_set_parallel_jobs(jobserver_support=True):
- args.append("--parallel={0}".format(make_jobs))
+ jobs = spack.build_environment.get_effective_jobs(
+ make_jobs,
+ parallel=self.parallel,
+ supports_jobserver=self.generator.supports_jobserver,
+ )
+ if jobs is not None:
+ args.append("--parallel={0}".format(jobs))
if "+ownlibs" in spec:
# Build and link to the CMake-provided third-party libraries
@@ -338,9 +347,7 @@ class Cmake(Package):
args.append("--")
else:
args.append("-DCMAKE_INSTALL_PREFIX=%s" % self.prefix)
- if self.spec.satisfies("platform=windows"):
- args.append("-GNinja")
- self.generator = ninja
+
args.append("-DCMAKE_BUILD_TYPE={0}".format(self.spec.variants["build_type"].value))
# Install CMake correctly, even if `spack install` runs
diff --git a/var/spack/repos/builtin/packages/ninja-fortran/package.py b/var/spack/repos/builtin/packages/ninja-fortran/package.py
index 371b350add..4709f51694 100644
--- a/var/spack/repos/builtin/packages/ninja-fortran/package.py
+++ b/var/spack/repos/builtin/packages/ninja-fortran/package.py
@@ -86,3 +86,12 @@ class NinjaFortran(Package):
# instead of 'ninja'. Install both for uniformity.
with working_dir(prefix.bin):
symlink("ninja", "ninja-build")
+
+ def setup_dependent_package(self, module, dspec):
+ name = "ninja"
+
+ module.ninja = MakeExecutable(
+ which_string(name, path=[self.spec.prefix.bin], required=True),
+ determine_number_of_jobs(parallel=self.parallel),
+ supports_jobserver=True, # This fork supports jobserver
+ )
diff --git a/var/spack/repos/builtin/packages/ninja/package.py b/var/spack/repos/builtin/packages/ninja/package.py
index e71b648f26..a6ee815a2b 100644
--- a/var/spack/repos/builtin/packages/ninja/package.py
+++ b/var/spack/repos/builtin/packages/ninja/package.py
@@ -79,4 +79,5 @@ class Ninja(Package):
module.ninja = MakeExecutable(
which_string(name, path=[self.spec.prefix.bin], required=True),
determine_number_of_jobs(parallel=self.parallel),
+ supports_jobserver=self.spec.version == ver("kitware"),
)