diff --git a/qt.jam b/qt.jam index cbfd5178b..ff5a37c18 100644 --- a/qt.jam +++ b/qt.jam @@ -33,7 +33,6 @@ rule init ( prefix ? ) type.register UI : ui ; type.register UIC_H : : H ; - type.set-generated-target-suffix UIC_H : : h ; generators.register-standard qt.uic-h : UI : UIC_H : qt ; diff --git a/src/build/property.jam b/src/build/property.jam index ef5c25b81..1d862972b 100644 --- a/src/build/property.jam +++ b/src/build/property.jam @@ -369,6 +369,14 @@ rule property-map ( ) # subset has value assigned to it, return the # value for the longest subset, if it's unique. rule find ( properties + ) + { + return [ find-replace $(properties) ] ; + } + + # Find the value associated with 'properties'. + # If 'value' parameter is given, replaces the found value + # Returns the value that were stored originally. + rule find-replace ( properties + : value ? ) { # First find all matches local matches ; @@ -388,7 +396,12 @@ rule property-map ( ) { errors.error "Ambiguous key" ; } - return $(self.value.$(best)) ; + local original = $(self.value.$(best)) ; + if $(value) + { + self.value.$(best) = $(value) ; + } + return $(original) ; } } diff --git a/src/build/type.jam b/src/build/type.jam index 207931dbf..61768d5f4 100644 --- a/src/build/type.jam +++ b/src/build/type.jam @@ -53,7 +53,7 @@ rule register ( type : suffixes * : base-type ? : main ? ) { # Generated targets of 'type' will use the first of 'suffixes' # (this may be overriden) - $(.suffixes).insert $(type) : $(suffixes[1]) ; + $(.suffixes).insert $(type) : $(suffixes[1]) ; # Specify mapping from suffixes to type register-suffixes $(suffixes) : $(type) ; } @@ -159,15 +159,31 @@ rule is-derived ( type base ) # one. rule set-generated-target-suffix ( type : properties * : suffix ) { - $(.suffixes).insert $(type) $(properties) : $(suffix) ; + properties = $(type) $(properties) ; + $(.suffixes).insert $(properties) : $(suffix) ; +} + +# Change the suffix previously registered for this type/properties +# combination. +rule change-generated-target-suffix ( type : properties * : suffix ) +{ + properties = $(type) $(properties) ; + $(.suffixes).find-replace $(properties) : $(suffix) ; } # Returns suffix that should be used when generating target of 'type', -# with the specified properties. +# with the specified properties. If not suffix were specified for +# 'type', returns suffix for base type, if any. rule generated-target-suffix ( type : properties * ) { - return [ $(.suffixes).find $(type) $(properties) ] ; + local result ; + while $(type) && ! $(result) + { + result = [ $(.suffixes).find $(type) $(properties) ] ; + type = $(.bases.$(type)) ; + } + return $(result) ; } # Returns file type given its suffix. The 'suffix' parameter should include