bool found_S_opt = false;
bool found_arch_opt = false;
bool found_pch = false;
+ bool found_fpch_preprocess = false;
const char *explicit_language = NULL; /* As specified with -x. */
const char *file_language; /* As deduced from file extension. */
const char *actual_language; /* Language to actually use. */
}
}
- if (str_eq(argv[i], "-fpch-preprocess")
- && !(sloppiness & SLOPPY_TIME_MACROS)) {
- cc_log("You have to specify \"time_macros\" sloppiness when using"
- " -fpch-preprocess");
- stats_update(STATS_UNSUPPORTED);
- result = false;
- goto out;
+ if (str_eq(argv[i], "-fpch-preprocess")) {
+ found_fpch_preprocess = true;
}
/* we must have -c */
goto out;
}
+ if ((found_pch || found_fpch_preprocess)
+ && !(sloppiness & SLOPPY_TIME_MACROS)) {
+ cc_log("You have to specify \"time_macros\" sloppiness when using"
+ " precompiled headers to get direct hits");
+ cc_log("Disabling direct mode");
+ enable_direct = false;
+ }
+
if (explicit_language && str_eq(explicit_language, "none")) {
explicit_language = NULL;
}
testname="no -fpch-preprocess, using -include"
$CCACHE -z >/dev/null
- $CCACHE $COMPILER -c -include pch.h pch2.c 2>/dev/null
+ CCACHE_SLOPPINESS=time_macros $CCACHE $COMPILER -c -include pch.h pch2.c 2>/dev/null
checkstat 'cache hit (direct)' 0
checkstat 'cache hit (preprocessed)' 0
checkstat 'cache miss' 1
- $CCACHE $COMPILER -c -include pch.h pch2.c 2>/dev/null
+ CCACHE_SLOPPINESS=time_macros $CCACHE $COMPILER -c -include pch.h pch2.c 2>/dev/null
checkstat 'cache hit (direct)' 1
checkstat 'cache hit (preprocessed)' 0
checkstat 'cache miss' 1
$CCACHE $COMPILER -c -fpch-preprocess pch.c
checkstat 'cache hit (direct)' 0
checkstat 'cache hit (preprocessed)' 0
- checkstat 'cache miss' 0
- checkstat 'unsupported compiler option' 1
+ checkstat 'cache miss' 1
+ $CCACHE $COMPILER -c -fpch-preprocess pch.c
+ checkstat 'cache hit (direct)' 0
+ checkstat 'cache hit (preprocessed)' 1
+ checkstat 'cache miss' 1
testname="-fpch-preprocess, sloppy time macros"
- $CCACHE -z >/dev/null
+ $CCACHE -zC >/dev/null
CCACHE_SLOPPINESS=time_macros $CCACHE $COMPILER -c -fpch-preprocess pch.c
checkstat 'cache hit (direct)' 0
checkstat 'cache hit (preprocessed)' 0