diff options
-rw-r--r-- | var/spack/repos/builtin/packages/zlib/package.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/zlib/package.py b/var/spack/repos/builtin/packages/zlib/package.py index 11ae411e91..a642d64b57 100644 --- a/var/spack/repos/builtin/packages/zlib/package.py +++ b/var/spack/repos/builtin/packages/zlib/package.py @@ -45,6 +45,8 @@ class Zlib(Package): description='Produce position-independent code (for shared libs)') variant('shared', default=True, description='Enables the build of shared libraries.') + variant('optimize', default=True, + description='Enable -O2 for a more optimized lib') patch('w_patch.patch', when="@1.2.11%cce") @@ -58,6 +60,8 @@ class Zlib(Package): def setup_environment(self, spack_env, run_env): if '+pic' in self.spec: spack_env.append_flags('CFLAGS', self.compiler.pic_flag) + if '+optimize' in self.spec: + spack_env.append_flags('CFLAGS', '-O2') def install(self, spec, prefix): config_args = [] |