// Handle options that should not be passed to the preprocessor.
if (compopt_affects_comp(args[i])) {
state.compiler_only_args.push_back(args[i]);
- if (compopt_takes_arg(args[i])) {
+ if (compopt_takes_arg(args[i])
+ || (ctx.guessed_compiler == GuessedCompiler::nvcc
+ && args[i] == "-Werror")) {
if (i == args.size() - 1) {
cc_log("Missing argument to %s", args[i].c_str());
return STATS_ARGS;
if ((args[i] == "-ccbin" || args[i] == "--compiler-bindir")
&& i + 1 < args.size()) {
- auto st = Stat::stat(args[i + 1], Stat::OnError::log);
+ auto st = Stat::stat(args[i + 1]);
if (st) {
found_ccbin = true;
hash.hash_delimiter("ccbin");
expect_stat 'cache miss' 1
expect_stat 'files in cache' 1
expect_equal_files reference_test1.o test_cpp.o
+
+ # -------------------------------------------------------------------------
+ TEST "Option -Werror"
+
+ $ccache_nvcc_cpp -Werror cross-execution-space-call test_cpp.cu
+ expect_stat 'cache hit (preprocessed)' 0
+ expect_stat 'cache miss' 1
+ expect_stat 'files in cache' 1
+
+ $ccache_nvcc_cpp -Werror cross-execution-space-call test_cpp.cu
+ expect_stat 'cache hit (preprocessed)' 1
+ expect_stat 'cache miss' 1
+ expect_stat 'files in cache' 1
}
SUITE_nvcc_PROBE() {