Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cfa01f6

Browse files
committed
Generate the xml manifest file.
1 parent 5504fd1 commit cfa01f6

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

numpy/distutils/command/config.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from distutils.msvccompiler import get_build_version as get_build_msvc_version
1414
from numpy.distutils.exec_command import exec_command
1515
from numpy.distutils.mingw32ccompiler import msvc_manifest_xml, \
16-
check_embedded_msvcr_match_linked
16+
check_embedded_msvcr_match_linked, manifest_name
1717

1818
LANG_EXT['f77'] = '.f'
1919
LANG_EXT['f90'] = '.f90'
@@ -118,7 +118,14 @@ def _link (self, body,
118118
if msver is not None:
119119
if msver >= 8:
120120
check_embedded_msvcr_match_linked(msver)
121-
121+
ma = int(msver)
122+
mi = int((msver - ma) * 10)
123+
# Write the manifest file
124+
manxml = msvc_manifest_xml(ma, mi)
125+
man = open(manifest_name(self), "w")
126+
self.temp_files.append(man)
127+
man.write(manxml)
128+
man.close()
122129
return self._wrap_method(old_config._link,lang,
123130
(body, headers, include_dirs,
124131
libraries, library_dirs, lang))

numpy/distutils/mingw32ccompiler.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,7 @@ def manifest_rc(name, type='dll'):
279279
'exe').
280280
281281
Parameters
282-
----------
283-
name: str
282+
---------- name: str
284283
name of the manifest file to embed
285284
type: str ('dll', 'exe')
286285
type of the binary which will embed the manifest"""
@@ -307,3 +306,10 @@ def check_embedded_msvcr_match_linked(msver):
307306
"Dyscrepancy between linked msvcr " \
308307
"(%d) and the one about to be embedded " \
309308
"(%d)" % (int(msver), maj)
309+
310+
def manifest_name(config):
311+
# Get configest name (including suffix)
312+
base = os.path.basename(config._gen_temp_sourcefile("yo", [], lang))
313+
root, ext = os.path.splitext(base)
314+
exext = self.compiler.exe_extension
315+
return root + exect + ".manifest"

0 commit comments

Comments
 (0)