Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3f6e7b9

Browse files
committed
More simplifications to FreeType setup on Windows.
- VS2010 is now always True -> perform constant folding.- Remove unused fixproj, tar_extract, zip_extract, DEPSSRC, DEPSBUILD, PYVER.- prepare_build_cmd is only called once so no need to cache VCVARSALL.- Remove unused imports.
1 parent2afeec7 commit3f6e7b9

File tree

2 files changed

+5
-48
lines changed

2 files changed

+5
-48
lines changed

‎setup_external_compile.py

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -19,54 +19,15 @@
1919
- VS 2010, 64 bit -- Windows SDK v7.1
2020
"""
2121

22-
importsys
2322
importplatform
24-
importos
25-
importglob
26-
importshutil
27-
importzipfile
28-
importtarfile
2923
importdistutils.msvc9compilerasmsvc
3024

31-
deffixproj(project_file,bit_target):
32-
"""
33-
:param bit_target: one of 'Win32' or 'x64'
34-
"""
35-
withopen(project_file,'r')asfd:
36-
content='\n'.join(line.strip()forlineinfdifline.strip())
37-
content=content.replace('Win32',bit_target).replace('x64',bit_target)
38-
withopen(project_file,'w')asfd:
39-
fd.write(content)
40-
41-
deftar_extract(tar_file,target):
42-
withtarfile.open(tar_file,'r:gz')astgz:
43-
tgz.extractall(target)
44-
45-
defzip_extract(zip_file,target):
46-
withzipfile.ZipFile(zip_file)aszf:
47-
zf.extractall(target)
48-
4925
# Configuration selection & declaration:
50-
DEPSSRC=os.path.join(os.path.dirname(os.path.normpath(__file__)),
51-
'deps_source')
52-
DEPSBUILD=os.path.join(os.path.dirname(os.path.normpath(__file__)),'build')
5326
X64=platform.architecture()[0]=='64bit'
54-
PYVER=sys.version_info[:2]
55-
VS2010=PYVER>= (3,3)
5627
xXX='x64'ifX64else'x86'
57-
# If not VS2010, then use VS2008
58-
59-
VCVARSALL=None
6028

6129
defprepare_build_cmd(build_cmd,**kwargs):
62-
globalVCVARSALL
30+
VCVARSALL=msvc.find_vcvarsall(10.0)
6331
ifVCVARSALL==None:
64-
candidate=msvc.find_vcvarsall(10.0ifVS2010else9.0)
65-
ifcandidate==None:
66-
raiseRuntimeError('Microsoft VS {} required'
67-
.format('2010'ifVS2010else'2008'))
68-
else:
69-
VCVARSALL=candidate
70-
71-
returnbuild_cmd.format(
72-
vcvarsall=VCVARSALL,xXX=xXX,**kwargs)
32+
raiseRuntimeError('Microsoft VS 2010 required')
33+
returnbuild_cmd.format(vcvarsall=VCVARSALL,xXX=xXX,**kwargs)

‎setupext.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,17 +1134,13 @@ def do_custom_build(self):
11341134
"""
11351135
fromsetup_external_compileimportfixproj,prepare_build_cmd,VS2010,X64,xXX
11361136
# Note: freetype has no build profile for 2014, so we don't bother...
1137-
vc='vc2010'ifVS2010else'vc2008'
1137+
vc='vc2010'
11381138
WinXX='x64'ifX64else'Win32'
1139-
# This is only false for py2.7, even on py3.5...
1140-
ifnotVS2010:
1141-
fixproj(os.path.join(src_path,'builds','windows',vc,'freetype.sln'),WinXX)
1142-
fixproj(os.path.join(src_path,'builds','windows',vc,'freetype.vcproj'),WinXX)
11431139

11441140
cmdfile=os.path.join("build","build_freetype.cmd")
11451141
withopen(cmdfile,'w')ascmd:
11461142
cmd.write(prepare_build_cmd(FREETYPE_BUILD_CMD,vc20xx=vc,WinXX=WinXX,
1147-
config='Release'ifVS2010else'LIB Release'))
1143+
config='Release'))
11481144

11491145
shutil.rmtree(str(Path(src_path,"objs")),ignore_errors=True)
11501146
subprocess.check_call([os.path.abspath(cmdfile)],

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp