]> git.tdb.fi Git - builder.git/commitdiff
Prepare early dependencies of a target before finding more
authorMikko Rasa <tdb@tdb.fi>
Tue, 27 Dec 2022 01:15:51 +0000 (03:15 +0200)
committerMikko Rasa <tdb@tdb.fi>
Tue, 27 Dec 2022 01:15:51 +0000 (03:15 +0200)
AndroidCompiler supplies build information for the C++ standard library,
which is consumed by Binary through ObjectFiles.  The compiler needs to
be prepared before Binary is, or the C++ stdlib won't be found.

source/target.cpp

index d701859524b19ef662e8e6178ef352a011c2e7cb..dbdd950e4a3bd7570c920b6122b0ee3cfcecf3e2 100644 (file)
@@ -122,6 +122,10 @@ void Target::prepare()
        }
 
        state = PREPARING;
+       /* Prepare existing dependencies early, because their information may be
+       needed to find other dependencies. */
+       for(Target *d: depends)
+               d->prepare();
        if(tool)
                tool->prepare();
 
@@ -140,6 +144,8 @@ void Target::prepare()
                broken |= (component && !component->get_problems().empty());
        }
 
+       /* Now that all dependencies are known, prepare them again.  This will do
+       nothing to already prepared targets. */
        for(Target *d: depends)
        {
                d->prepare();