if ((str_eq(args->argv[i], "-ccbin")
|| str_eq(args->argv[i], "--compiler-bindir"))
&& i + 1 < args->argc
- && x_stat(args->argv[i+1], &st) == 0) {
+ && stat(args->argv[i+1], &st) == 0) {
found_ccbin = true;
hash_delimiter(hash, "ccbin");
hash_nvcc_host_compiler(hash, &st, args->argv[i+1]);
// Handle options that should not be passed to the preprocessor.
if (compopt_affects_comp(argv[i])) {
args_add(compiler_only_args, argv[i]);
- if (compopt_takes_arg(argv[i])) {
+ if (compopt_takes_arg(argv[i])
+ || (guessed_compiler == GUESSED_NVCC && str_eq(argv[i], "-Werror"))) {
if (i == argc - 1) {
cc_log("Missing argument to %s", argv[i]);
stats_update(STATS_ARGS);
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() {