File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed 
main/java/com/google/devtools/build/lib/rules/cpp 
test/java/com/google/devtools/build/lib/rules/cpp Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -1142,6 +1142,7 @@ public FragmentOptions getHost() {
11421142    host .experimentalLinkStaticLibrariesOnce  = experimentalLinkStaticLibrariesOnce ;
11431143    host .experimentalEnableTargetExportCheck  = experimentalEnableTargetExportCheck ;
11441144    host .experimentalCcSharedLibraryDebug  = experimentalCcSharedLibraryDebug ;
1145+     host .experimentalCcImplementationDeps  = experimentalCcImplementationDeps ;
11451146
11461147    host .coptList  = coptListBuilder .addAll (hostCoptList ).build ();
11471148    host .cxxoptList  = cxxoptListBuilder .addAll (hostCxxoptList ).build ();
Original file line number Diff line number Diff line change @@ -1991,6 +1991,37 @@ public void testImplementationDepsLinkingContextIsPropagated() throws Exception
19911991        .contains ("bin foo/libimplementation_dep.a" );
19921992  }
19931993
1994+   @ Test 
1995+   public  void  testImplementationDepsConfigurationHostSucceeds () throws  Exception  {
1996+     useConfiguration ("--experimental_cc_implementation_deps" );
1997+     scratch .file (
1998+         "foo/BUILD" ,
1999+         "cc_binary(" ,
2000+         "    name = 'bin'," ,
2001+         "    srcs = ['bin.cc']," ,
2002+         "    deps = ['lib']," ,
2003+         ")" ,
2004+         "cc_library(" ,
2005+         "    name = 'lib'," ,
2006+         "    srcs = ['lib.cc']," ,
2007+         "    deps = ['public_dep']," ,
2008+         ")" ,
2009+         "cc_library(" ,
2010+         "    name = 'public_dep'," ,
2011+         "    srcs = ['public_dep.cc']," ,
2012+         "    hdrs = ['public_dep.h']," ,
2013+         "    implementation_deps = ['implementation_dep']," ,
2014+         ")" ,
2015+         "cc_library(" ,
2016+         "    name = 'implementation_dep'," ,
2017+         "    srcs = ['implementation_dep.cc']," ,
2018+         "    hdrs = ['implementation_dep.h']," ,
2019+         ")" );
2020+ 
2021+     getHostConfiguredTarget ("//foo:bin" );
2022+     assertDoesNotContainEvent ("requires --experimental_cc_implementation_deps" );
2023+   }
2024+ 
19942025  @ Test 
19952026  public  void  testImplementationDepsFailsWithoutFlag () throws  Exception  {
19962027    scratch .file (
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments