Skip to content

Commit

Permalink
Evaluate conditions for CMake dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-reynolds committed Feb 20, 2021
1 parent a9672d7 commit 803348f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmake/parse_package_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from __future__ import print_function

import argparse
import os
import sys
from collections import OrderedDict

Expand Down Expand Up @@ -82,7 +83,7 @@ def _get_output(package):

def _get_dependency_values(key, depends):
values = OrderedDict()
values[key] = ' '.join(['"%s"' % str(d) for d in depends])
values[key] = ' '.join(['"%s"' % str(d) for d in depends if d.evaluated_condition is not False])
for d in depends:
comparisons = ['version_lt', 'version_lte', 'version_eq', 'version_gte', 'version_gt']
for comp in comparisons:
Expand All @@ -99,6 +100,7 @@ def main(argv=sys.argv[1:]):
parser.add_argument('outfile')
args = parser.parse_args(argv)
package = parse_package(args.package_xml)
package.evaluate_conditions(os.environ)

# Force utf8 encoding for python3.
# This way unicode files can still be processed on non-unicode locales.
Expand Down

0 comments on commit 803348f

Please sign in to comment.