diff options
Diffstat (limited to 'Lib/distutils/command')
-rw-r--r-- | Lib/distutils/command/build_ext.py | 6 | ||||
-rw-r--r-- | Lib/distutils/command/config.py | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py index 934b457..4bfc20c 100644 --- a/Lib/distutils/command/build_ext.py +++ b/Lib/distutils/command/build_ext.py @@ -477,6 +477,9 @@ class build_ext (Command): objects.extend(ext.extra_objects) extra_args = ext.extra_link_args or [] + # Detect target language, if not provided + language = ext.language or self.compiler.detect_language(sources) + self.compiler.link_shared_object( objects, ext_filename, libraries=self.get_libraries(ext), @@ -485,7 +488,8 @@ class build_ext (Command): extra_postargs=extra_args, export_symbols=self.get_export_symbols(ext), debug=self.debug, - build_temp=self.build_temp) + build_temp=self.build_temp, + target_lang=language) def swig_sources (self, sources): diff --git a/Lib/distutils/command/config.py b/Lib/distutils/command/config.py index 88b1586..9ebe0d9 100644 --- a/Lib/distutils/command/config.py +++ b/Lib/distutils/command/config.py @@ -148,7 +148,8 @@ class config (Command): prog = os.path.splitext(os.path.basename(src))[0] self.compiler.link_executable([obj], prog, libraries=libraries, - library_dirs=library_dirs) + library_dirs=library_dirs, + target_lang=lang) prog = prog + self.compiler.exe_extension self.temp_files.append(prog) |