diff options
-rw-r--r-- | var/spack/repos/builtin/packages/pegtl/package.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/pegtl/package.py b/var/spack/repos/builtin/packages/pegtl/package.py index 96cad29eec..148d972667 100644 --- a/var/spack/repos/builtin/packages/pegtl/package.py +++ b/var/spack/repos/builtin/packages/pegtl/package.py @@ -25,3 +25,25 @@ class Pegtl(CMakePackage): # Ref: https://github.com/taocpp/PEGTL/blob/master/src/example/pegtl/json_classes.hpp patch('change_to_virtual_destructor.patch', when='@:2.4') + + def cmake_args(self): + + args = [] + if self.run_tests: + args.extend([ + '-DPEGTL_BUILD_EXAMPLES=ON', + '-DPEGTL_BUILD_TESTS=ON' + ]) + else: + args.extend([ + '-DPEGTL_BUILD_EXAMPLES=OFF', + '-DPEGTL_BUILD_TESTS=OFF' + ]) + + return args + + @run_after('build') + @on_package_attributes(run_tests=True) + def check(self): + with working_dir(self.build_directory): + make('test', parallel=False) |