Summary
When ar
jobcache is enabled, emake looks first at the output target name, to see if it matches either .a
or .la
. Then emake also checks to see if the job is invoking ranlib
, libtool
or ar
, so that it doesn’t accidentally try to apply jobcache to jobs it should not — for example, jobs that happen to generate files named *.a
that are not really libraries, or jobs that are not running an archiving tool but instead are doing something like copying a file from one location to another, or extracting the library from a compressed archive, or something else altogether.
Problem
If you are not using one of the above 3 tools to generate static libraries, emake may not detect that ar
jobcache should be applied to those jobs.
Solution
There is a simple solution for this problem which involves using an emake pragmafile to explicitly add ar
jobcache to these jobs. That could be as trivial as creating a file emake.pragmas
with this content:
#pragma jobcache ar %.a:
And invoking emake with --emake-pragmafile=emake.pragmas
. This will cause emake to apply ar
jobcache to any job with an output matching the pattern %.a
, without relying on the heuristics to autodetermine jobcache types.