add input and output files to hash for correct operation when swig is the compiler. Automatically detect when swig is the compiler.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10931 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
8ac9453f62
commit
a5d91ce4f1
2 changed files with 24 additions and 11 deletions
|
|
@ -195,7 +195,6 @@ 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());
|
||||
|
||||
/* TODO swig */
|
||||
if (output_file) {
|
||||
args_add(args, "-o");
|
||||
args_add(args, output_file);
|
||||
|
|
@ -384,13 +383,19 @@ static void find_hash(ARGS *args)
|
|||
|
||||
/* when we are doing the unifying tricks we need to include
|
||||
the input file name in the hash to get the warnings right */
|
||||
if (enable_unify) {
|
||||
if (enable_unify || swig) {
|
||||
hash_string(input_file);
|
||||
}
|
||||
|
||||
/* we have to hash the extension, as a .i file isn't treated the same
|
||||
by the compiler as a .ii file (Note: not strictly necessary for SWIG) */
|
||||
hash_string(i_extension);
|
||||
if (swig) {
|
||||
if (output_file) {
|
||||
hash_string(output_file);
|
||||
}
|
||||
} else {
|
||||
/* we have to hash the extension, as a .i file isn't treated the same
|
||||
by the compiler as a .ii file */
|
||||
hash_string(i_extension);
|
||||
}
|
||||
|
||||
/* first the arguments */
|
||||
for (i=1;i<args->argc;i++) {
|
||||
|
|
@ -1055,6 +1060,15 @@ static void process_args(int argc, char **argv)
|
|||
}
|
||||
}
|
||||
|
||||
static void detect_swig()
|
||||
{
|
||||
char *basename = str_basename(orig_args->argv[0]);
|
||||
if (strstr(basename, "swig") || getenv("CCACHE_SWIG")) {
|
||||
swig = 1;
|
||||
}
|
||||
free(basename);
|
||||
}
|
||||
|
||||
/* the main ccache driver function */
|
||||
static void ccache(int argc, char *argv[])
|
||||
{
|
||||
|
|
@ -1078,9 +1092,7 @@ static void ccache(int argc, char *argv[])
|
|||
enable_unify = 1;
|
||||
}
|
||||
|
||||
if (getenv("CCACHE_SWIG")) {
|
||||
swig = 1;
|
||||
}
|
||||
detect_swig();
|
||||
|
||||
/* process argument list, returning a new set of arguments for pre-processing */
|
||||
process_args(orig_args->argc, orig_args->argv);
|
||||
|
|
|
|||
|
|
@ -233,9 +233,10 @@ systems like this you can use the CCACHE_EXTENSION option to override
|
|||
the default. On HP-UX set this environment variable to "i" if you use
|
||||
the aCC compiler.
|
||||
|
||||
dit(bf(CCACHE_SWIG)) The CCACHE_SWIG environment variable needs to be
|
||||
set in order for ccache to work with SWIG. Currently the CCACHE_CPP2
|
||||
environment variable also needs to be set in order to work with SWIG.
|
||||
dit(bf(CCACHE_SWIG)) When using SWIG as the compiler and it does not
|
||||
have 'swig' in the executable name, then the CCACHE_SWIG environment
|
||||
variable needs to be set in order for ccache to work correctly with
|
||||
SWIG.
|
||||
|
||||
enddit()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue