@@ -711,35 +711,6 @@ List<PathFragment> getSystemIncludeDirs() throws CommandLineExpansionException {
711
711
return getSystemIncludeDirs (getCompilerOptions ());
712
712
}
713
713
714
- private static final ImmutableList <CharMatcher > MSVC_CHARS =
715
- ImmutableList .of (
716
- CharMatcher .anyOf ("mM" ),
717
- CharMatcher .anyOf ("sS" ),
718
- CharMatcher .anyOf ("vV" ),
719
- CharMatcher .anyOf ("cC" ));
720
- private static final ImmutableList <CharMatcher > INCLUDE_PREFIX_CHARS =
721
- ImmutableList .of (CharMatcher .anyOf ("-/" ), CharMatcher .anyOf ("iI" ));
722
-
723
- private static boolean substrMatchesChars (
724
- String s , int startPos , ImmutableList <CharMatcher > substr ) {
725
- for (int i = 0 ; i < substr .size (); i ++) {
726
- if (!substr .get (i ).matches (s .charAt (startPos + i ))) {
727
- return false ;
728
- }
729
- }
730
- return true ;
731
- }
732
-
733
- private static boolean matchesCaseInsensitiveMsvc (String s ) {
734
- return s .length () >= 4 && substrMatchesChars (s , 0 , MSVC_CHARS );
735
- }
736
-
737
- private static boolean matchesIncludeCaseInsensitiveMsvc (String s ) {
738
- return s .length () >= 6
739
- && substrMatchesChars (s , 0 , INCLUDE_PREFIX_CHARS )
740
- && substrMatchesChars (s , 2 , MSVC_CHARS );
741
- }
742
-
743
714
private List <PathFragment > getSystemIncludeDirs (List <String > compilerOptions ) {
744
715
// TODO(bazel-team): parsing the command line flags here couples us to gcc- and clang-cl-style
745
716
// compiler command lines; use a different way to specify system includes (for example through a
@@ -773,6 +744,35 @@ private List<PathFragment> getSystemIncludeDirs(List<String> compilerOptions) {
773
744
return result .build ();
774
745
}
775
746
747
+ private static final ImmutableList <CharMatcher > MSVC_CHARS =
748
+ ImmutableList .of (
749
+ CharMatcher .anyOf ("mM" ),
750
+ CharMatcher .anyOf ("sS" ),
751
+ CharMatcher .anyOf ("vV" ),
752
+ CharMatcher .anyOf ("cC" ));
753
+ private static final ImmutableList <CharMatcher > INCLUDE_PREFIX_CHARS =
754
+ ImmutableList .of (CharMatcher .anyOf ("-/" ), CharMatcher .anyOf ("iI" ));
755
+
756
+ private static boolean substrMatchesChars (
757
+ String s , int startPos , ImmutableList <CharMatcher > substr ) {
758
+ for (int i = 0 ; i < substr .size (); i ++) {
759
+ if (!substr .get (i ).matches (s .charAt (startPos + i ))) {
760
+ return false ;
761
+ }
762
+ }
763
+ return true ;
764
+ }
765
+
766
+ private static boolean matchesCaseInsensitiveMsvc (String s ) {
767
+ return s .length () >= 4 && substrMatchesChars (s , 0 , MSVC_CHARS );
768
+ }
769
+
770
+ private static boolean matchesIncludeCaseInsensitiveMsvc (String s ) {
771
+ return s .length () >= 6
772
+ && substrMatchesChars (s , 0 , INCLUDE_PREFIX_CHARS )
773
+ && substrMatchesChars (s , 2 , MSVC_CHARS );
774
+ }
775
+
776
776
private static ImmutableList <String > getCmdlineIncludes (List <String > args ) {
777
777
ImmutableList .Builder <String > cmdlineIncludes = ImmutableList .builder ();
778
778
for (Iterator <String > argi = args .iterator (); argi .hasNext (); ) {
0 commit comments