Boost logo

Boost-Build :

Subject: Re: [Boost-build] embed manifest file
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2014-03-28 17:41:27


AMDG

On 03/28/2014 01:49 PM, tr1gun wrote:
>
> The problem i faced that the properties variable in the link / link.dll
> rule is only a raw string and the file target for embed-manifest-file is
> lost.

What do you mean by a "raw string?" The list of
properties should contain <embed-manifest-file>object(file-target)@NNNNN
which you can extract with
[ feature.get-values <embed-manifest-file> : $(properties) ]

> I tried it with a variable like DEF_FILE but i faced some problems with
> labels in the action. Are actions executed like batch files?

Yes. b2 creates a temporary batch file and
executes it with cmd.exe. If I need to access
a variable like this in the rule, I usually use
something like

flags msvc.manifest MANIFEST_FILE <embed-manifest-file> ;
rule manifest ( targets * : sources * : properties * )
{
    local file = [ on $(targets) return $(MANIFEST_FILE) ] ;
}

> I also
> noticed that boost build doesn't recognize the failure on the next run
> and you would need to delete the target dll or rebuild everything.
> Therefore i introduced a new target so it can detect the failure on the
> next run.
>

Are you sure about that? b2 is supposed delete targets
that failed to update. It does relink when the existing
embed-manifest handling fails (which happens on a regular
basis "mt.exe : general error c101008d: Failed to write
the updated manifest to the resource of file "xxx.exe".
The process cannot access the file because it is being
used by another process.").

In Christ,
Steven Watanabe


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk