diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2008-12-21 23:16:56 +0000 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2008-12-21 23:16:56 +0000 |
commit | a648bb7f38660ce1acd4803097cf6ba63149da1c (patch) | |
tree | 4d688c33a8506ca263dd062514c61e1aa31f19be /CCache/ccache.c | |
parent | b1e7bbd831d1ae60f04ce4204c0c2a39422f6302 (diff) | |
download | swig-a648bb7f38660ce1acd4803097cf6ba63149da1c.tar.gz |
Add CCACHE_STRIPC option to remove an unwarranted warning when using ccache with the Solaris Workshop C++ compiler
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10996 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'CCache/ccache.c')
-rw-r--r-- | CCache/ccache.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/CCache/ccache.c b/CCache/ccache.c index ce9717b84..486964377 100644 --- a/CCache/ccache.c +++ b/CCache/ccache.c @@ -68,6 +68,9 @@ char *stats_file = NULL; /* can we safely use the unification hashing backend? */ static int enable_unify; +/* should we strip -c when running the preprocessor only? */ +static int strip_c_option; + /* customisation for using the SWIG compiler */ static int swig; @@ -230,6 +233,10 @@ static void to_cache(ARGS *args) x_asprintf(&tmp_stderr, "%s/tmp.stderr.%s", temp_dir, tmp_string()); x_asprintf(&tmp_outfiles, "%s/tmp.outfiles.%s", temp_dir, tmp_string()); + if (strip_c_option) { + args_add(stripped_args, "-c"); + } + if (output_file) { args_add(args, "-o"); args_add(args, output_file); @@ -859,7 +866,9 @@ static void process_args(int argc, char **argv) /* we must have -c */ if (strcmp(argv[i], "-c") == 0) { - args_add(stripped_args, argv[i]); + if (!strip_c_option) { + args_add(stripped_args, argv[i]); + } found_c_opt = 1; continue; } @@ -1126,6 +1135,10 @@ static void ccache(int argc, char *argv[]) failed(); } + if (getenv("CCACHE_STRIPC")) { + strip_c_option = 1; + } + if (getenv("CCACHE_UNIFY")) { enable_unify = 1; } |