diff options
author | Chun-wei Fan <fanchunwei@src.gnome.org> | 2017-04-25 12:40:46 +0800 |
---|---|---|
committer | Chun-wei Fan <fanchunwei@src.gnome.org> | 2017-05-01 09:14:02 +0800 |
commit | 6b703b3211ce45389a777a439ccdf8fd64ed2b30 (patch) | |
tree | 5f5d2b19f4968e8a4461eb42585c7e2ad12968ed /giscanner/sourcescanner.py | |
parent | e65915cd4fc6a69bd68d2193607f83f9815fe80e (diff) | |
download | gobject-introspection-6b703b3211ce45389a777a439ccdf8fd64ed2b30.tar.gz |
giscanner: Update location of temp sources and objects
For preprocessing, when we create the temp file for preprocessing, make
the temp file be stored in CWD instead of the system's temp directory;
and when we compile the dumper program, set the output_dir to be the
root directory (<drive letter>:\ on Windows and / otherwise).
This is because distutils insists on using the full path from the root
directory to compile sources, so that if we set the output_dir as we now
do we will get
$(abs_srcdir)/$(tmpdir)/<$(abs_srcdir)_minus_rootdir>/$(tmpdir)/<target_gir_file_name>.[o|obj].
https://bugzilla.gnome.org/show_bug.cgi?id=781525
Diffstat (limited to 'giscanner/sourcescanner.py')
-rw-r--r-- | giscanner/sourcescanner.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/giscanner/sourcescanner.py b/giscanner/sourcescanner.py index 049ae162..30fa75f0 100644 --- a/giscanner/sourcescanner.py +++ b/giscanner/sourcescanner.py @@ -290,7 +290,9 @@ class SourceScanner(object): cc = CCompiler() - tmp_fd_cpp, tmp_name_cpp = tempfile.mkstemp(prefix='g-ir-cpp-', suffix='.c') + tmp_fd_cpp, tmp_name_cpp = tempfile.mkstemp(prefix='g-ir-cpp-', + suffix='.c', + dir=os.getcwd()) with os.fdopen(tmp_fd_cpp, 'wb') as fp_cpp: self._write_preprocess_src(fp_cpp, defines, undefs, filenames) |