pegtl: manage options to build examples and tests when run_tests (#21866)
Co-authored-by: Daryl W. Grunau <dwg@lanl.gov>
This commit is contained in:
parent
4453058862
commit
55eae72bb0
@ -25,3 +25,25 @@ class Pegtl(CMakePackage):
|
|||||||
|
|
||||||
# Ref: https://github.com/taocpp/PEGTL/blob/master/src/example/pegtl/json_classes.hpp
|
# Ref: https://github.com/taocpp/PEGTL/blob/master/src/example/pegtl/json_classes.hpp
|
||||||
patch('change_to_virtual_destructor.patch', when='@:2.4')
|
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user