diff --git a/setup_external_compile.py b/setup_external_compile.py index c7a59515c9f0..4ee60120f1b9 100644 --- a/setup_external_compile.py +++ b/setup_external_compile.py @@ -53,6 +53,7 @@ def zip_extract(zip_file, target): X64 = platform.architecture()[0] == '64bit' PYVER = sys.version_info[:2] VS2010 = PYVER >= (3, 3) +xXX = 'x64' if X64 else 'x86' # If not VS2010, then use VS2008 VCVARSALL = None @@ -68,4 +69,4 @@ def prepare_build_cmd(build_cmd, **kwargs): VCVARSALL = candidate return build_cmd.format( - vcvarsall=VCVARSALL, xXX='x64' if X64 else 'x86', **kwargs) + vcvarsall=VCVARSALL, xXX=xXX, **kwargs) diff --git a/setupext.py b/setupext.py index 6d363012eb4e..159ce9ea1108 100644 --- a/setupext.py +++ b/setupext.py @@ -1122,23 +1122,15 @@ def do_custom_build(self): subprocess.check_call(["make"], env=env, cwd=src_path) else: # compilation on windows - FREETYPE_BUILD_CMD = """\ -call "%ProgramFiles%\\Microsoft SDKs\\Windows\\v7.0\\Bin\\SetEnv.Cmd" /Release /{xXX} /xp + FREETYPE_BUILD_CMD = r""" +call "%ProgramFiles%\Microsoft SDKs\Windows\v7.0\Bin\SetEnv.Cmd" ^ + /Release /{xXX} /xp call "{vcvarsall}" {xXX} -set MSBUILD=C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\MSBuild.exe -rd /S /Q %FREETYPE%\\objs -%MSBUILD% %FREETYPE%\\builds\\windows\\{vc20xx}\\freetype.sln /t:Clean;Build /p:Configuration="{config}";Platform={WinXX} -echo Build completed, moving result" -:: move to the "normal" path for the unix builds... -mkdir %FREETYPE%\\objs\\.libs -:: REMINDER: fix when changing the version -copy %FREETYPE%\\objs\\{vc20xx}\\{xXX}\\freetype261.lib %FREETYPE%\\objs\\.libs\\libfreetype.lib -if errorlevel 1 ( - rem This is a py27 version, which has a different location for the lib file :-/ - copy %FREETYPE%\\objs\\win32\\{vc20xx}\\freetype261.lib %FREETYPE%\\objs\\.libs\\libfreetype.lib -) +set MSBUILD=C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe +%MSBUILD% "builds\windows\{vc20xx}\freetype.sln" ^ + /t:Clean;Build /p:Configuration="{config}";Platform={WinXX} """ - from setup_external_compile import fixproj, prepare_build_cmd, VS2010, X64 + from setup_external_compile import fixproj, prepare_build_cmd, VS2010, X64, xXX # Note: freetype has no build profile for 2014, so we don't bother... vc = 'vc2010' if VS2010 else 'vc2008' WinXX = 'x64' if X64 else 'Win32' @@ -1147,13 +1139,21 @@ def do_custom_build(self): fixproj(os.path.join(src_path, 'builds', 'windows', vc, 'freetype.sln'), WinXX) fixproj(os.path.join(src_path, 'builds', 'windows', vc, 'freetype.vcproj'), WinXX) - cmdfile = os.path.join("build", 'build_freetype.cmd') + cmdfile = os.path.join("build", "build_freetype.cmd") with open(cmdfile, 'w') as cmd: cmd.write(prepare_build_cmd(FREETYPE_BUILD_CMD, vc20xx=vc, WinXX=WinXX, config='Release' if VS2010 else 'LIB Release')) - os.environ['FREETYPE'] = src_path - subprocess.check_call([cmdfile], shell=True) + shutil.rmtree(str(Path(src_path, "objs")), ignore_errors=True) + subprocess.check_call([os.path.abspath(cmdfile)], + shell=True, cwd=src_path) + # Move to the corresponding Unix build path. + Path(src_path, "objs/.libs").mkdir() + # Be robust against change of FreeType version. + lib_path, = (Path(src_path, "objs", vc, xXX) + .glob("freetype*.lib")) + shutil.copy2(str(lib_path), + str(Path(src_path, "objs/.libs/libfreetype.lib"))) class FT2Font(SetupPackage): pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy