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

Appearance settings

Commit b71fd6a

Browse filesBrowse files
committed
Inline setup_external_compile into setupext.
1 parent 7544c46 commit b71fd6a
Copy full SHA for b71fd6a

File tree

Expand file treeCollapse file tree

3 files changed

+12
-45
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+12
-45
lines changed

‎pytest.ini

Copy file name to clipboardExpand all lines: pytest.ini
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ pep8ignore =
1212

1313
setup.py E402
1414
setupext.py E301 E302 E501
15-
setup_external_compile.py E302 E711
1615

1716
versioneer.py ALL # External file.
1817
tools/gh_api.py ALL # External file.

‎setup_external_compile.py

Copy file name to clipboardExpand all lines: setup_external_compile.py
-33Lines changed: 0 additions & 33 deletions
This file was deleted.

‎setupext.py

Copy file name to clipboardExpand all lines: setupext.py
+12-11Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,26 +1124,27 @@ def do_custom_build(self):
11241124
subprocess.check_call(["make"], env=env, cwd=src_path)
11251125
else:
11261126
# compilation on windows
1127+
shutil.rmtree(str(Path(src_path, "objs")), ignore_errors=True)
11271128
FREETYPE_BUILD_CMD = r"""
11281129
call "%ProgramFiles%\Microsoft SDKs\Windows\v7.0\Bin\SetEnv.Cmd" ^
11291130
/Release /{xXX} /xp
11301131
call "{vcvarsall}" {xXX}
11311132
set MSBUILD=C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
11321133
%MSBUILD% "builds\windows\{vc20xx}\freetype.sln" ^
1133-
/t:Clean;Build /p:Configuration="{config}";Platform={WinXX}
1134+
/t:Clean;Build /p:Configuration="Release";Platform={WinXX}
11341135
"""
1135-
from setup_external_compile import prepare_build_cmd, X64, xXX
1136+
import distutils.msvc9compiler as msvc
11361137
# Note: freetype has no build profile for 2014, so we don't bother...
11371138
vc = 'vc2010'
1138-
WinXX = 'x64' if X64 else 'Win32'
1139-
1140-
cmdfile = os.path.join("build", "build_freetype.cmd")
1141-
with open(cmdfile, 'w') as cmd:
1142-
cmd.write(prepare_build_cmd(FREETYPE_BUILD_CMD, vc20xx=vc, WinXX=WinXX,
1143-
config='Release'))
1144-
1145-
shutil.rmtree(str(Path(src_path, "objs")), ignore_errors=True)
1146-
subprocess.check_call([os.path.abspath(cmdfile)],
1139+
WinXX = 'x64' if platform.architecture()[0] == '64bit' else 'Win32'
1140+
xXX = 'x64' if platform.architecture()[0] == '64bit' else 'x86'
1141+
vcvarsall = msvc.find_vcvarsall(10.0)
1142+
if vcvarsall is None:
1143+
raise RuntimeError('Microsoft VS 2010 required')
1144+
cmdfile = Path("build/build_freetype.cmd")
1145+
cmdfile.write_text(FREETYPE_BUILD_CMD.format(
1146+
vc20xx=vc, WinXX=WinXX, xXX=xXX, vcvarsall=vcvarsall))
1147+
subprocess.check_call([str(cmdfile.resolve())],
11471148
shell=True, cwd=src_path)
11481149
# Move to the corresponding Unix build path.
11491150
Path(src_path, "objs/.libs").mkdir()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.