diff options
author | 2016-12-16 11:30:38 +0000 | |
---|---|---|
committer | 2016-12-16 15:37:10 +0000 | |
commit | 0f4260bf916d70457f358a1f1dfbbd55d4c4b04c (patch) | |
tree | 30d77e5777d184c186a3af12ecd1851b04a376bf /src/main/java/com/google/devtools/build/lib/rules/cpp/CcLibrary.java | |
parent | 1324e83e04757b45b78b01a1ab24bab4c6156231 (diff) |
Add option to dynamically link in the compilation output of cc_test and
cc_binary if we are doing dynamic linking anyway. The additional option is
only for a smooth rollout and will go away once everything works as expected.
The benefit is in an incremental save-build-test-cycle. When editing a test (or
any of it's transitive headers), the linker input currently changes, meaning we
need to do the full link again before the test can run. However, in conjunction
with the option --interface_shared_objects, this actually isn't necessary. With
this new option, the test source gets compiled into a .so file and while that
file changes with each source change, the .ifso file often does not change.
Thus, the costly link linking to gether all the .so and .ifso files can be
retrieved from cache. Thus, this change should remove this linking step from
the critical path of many save-build-test-cycles.
--
PiperOrigin-RevId: 142244352
MOS_MIGRATED_REVID=142244352
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/CcLibrary.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CcLibrary.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLibrary.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLibrary.java index 54be53e229..d7d2e7a08a 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLibrary.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLibrary.java @@ -274,10 +274,12 @@ public abstract class CcLibrary implements RuleConfiguredTargetFactory { .addProviders(info.getProviders()) .addSkylarkTransitiveInfo(CcSkylarkApiProvider.NAME, new CcSkylarkApiProvider()) .addOutputGroups(info.getOutputGroups()) - .add(InstrumentedFilesProvider.class, instrumentedFilesProvider) - .add(RunfilesProvider.class, RunfilesProvider.withData(staticRunfiles, sharedRunfiles)) + .addProvider(InstrumentedFilesProvider.class, instrumentedFilesProvider) + .addProvider( + RunfilesProvider.class, RunfilesProvider.withData(staticRunfiles, sharedRunfiles)) // Remove this? - .add(CppRunfilesProvider.class, new CppRunfilesProvider(staticRunfiles, sharedRunfiles)) + .addProvider( + CppRunfilesProvider.class, new CppRunfilesProvider(staticRunfiles, sharedRunfiles)) .addOutputGroup( OutputGroupProvider.HIDDEN_TOP_LEVEL, collectHiddenTopLevelArtifacts(ruleContext, info.getCcCompilationOutputs())) |