From aa1274fe71990d8d4bfd9240970d80ffb5361680 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Thu, 20 Mar 2003 02:41:49 +0000 Subject: [PATCH] Fix usage requirements check to account for conditional properties. I'm not completely sure this is precisely the right fix: a. The error message used to reference a non-existent variable. What was it supposed to be? b. Should property.remove et. al. be able to cope with conditional properties? [SVN r18023] --- new/project.jam | 12 ++++++++++-- v2/build/project.jam | 12 ++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/new/project.jam b/new/project.jam index 43d6291fe..abcfa8d88 100644 --- a/new/project.jam +++ b/new/project.jam @@ -453,10 +453,18 @@ rule project-attributes ( location ) } else if $(attribute) = "usage-requirements" { - local non-free = [ property.remove free : $(specification) ] ; + local unconditional ; + for local p in $(specification) + { + local split = [ property.split-conditional $(p) ] ; + split ?= nothing $(p) ; + unconditional += $(split[2]) ; + } + + local non-free = [ property.remove free : $(unconditional) ] ; if $(non-free) { - errors.error "usage-requirements" $($(real-pos2)) "have non-free properties" $(non-free) ; + errors.error "usage-requirements" $(specification) "have non-free properties" $(non-free) ; } local t = [ property.translate-paths $(specification) : $(self.location) ] ; diff --git a/v2/build/project.jam b/v2/build/project.jam index 43d6291fe..abcfa8d88 100644 --- a/v2/build/project.jam +++ b/v2/build/project.jam @@ -453,10 +453,18 @@ rule project-attributes ( location ) } else if $(attribute) = "usage-requirements" { - local non-free = [ property.remove free : $(specification) ] ; + local unconditional ; + for local p in $(specification) + { + local split = [ property.split-conditional $(p) ] ; + split ?= nothing $(p) ; + unconditional += $(split[2]) ; + } + + local non-free = [ property.remove free : $(unconditional) ] ; if $(non-free) { - errors.error "usage-requirements" $($(real-pos2)) "have non-free properties" $(non-free) ; + errors.error "usage-requirements" $(specification) "have non-free properties" $(non-free) ; } local t = [ property.translate-paths $(specification) : $(self.location) ] ;