Commit 0c1d09e 1 parent 2986222 commit 0c1d09e Copy full SHA for 0c1d09e
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
2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -1142,6 +1142,7 @@ public FragmentOptions getHost() {
1142
1142
host .experimentalLinkStaticLibrariesOnce = experimentalLinkStaticLibrariesOnce ;
1143
1143
host .experimentalEnableTargetExportCheck = experimentalEnableTargetExportCheck ;
1144
1144
host .experimentalCcSharedLibraryDebug = experimentalCcSharedLibraryDebug ;
1145
+ host .experimentalCcImplementationDeps = experimentalCcImplementationDeps ;
1145
1146
1146
1147
host .coptList = coptListBuilder .addAll (hostCoptList ).build ();
1147
1148
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
1991
1991
.contains ("bin foo/libimplementation_dep.a" );
1992
1992
}
1993
1993
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
+
1994
2025
@ Test
1995
2026
public void testImplementationDepsFailsWithoutFlag () throws Exception {
1996
2027
scratch .file (
You can’t perform that action at this time.
0 commit comments