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

Skip to content

Commit 0aa303c

Browse files
committed
BLD: Detect /MT flag and build corresponding freetype
1 parent afd298e commit 0aa303c

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

setupext.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,6 +1265,16 @@ def spawn(command):
12651265
else:
12661266
return cmd.compiler.spawn(command)
12671267

1268+
if cmd.debug:
1269+
mt = '/MTd' in cmd.compiler.compile_options_debug
1270+
else:
1271+
mt = '/MT' in cmd.compiler.compile_options
1272+
1273+
if mt:
1274+
vc_config += ' Multithreaded'
1275+
1276+
postfix = 'MT' if mt else ''
1277+
12681278
if get_build_version() < 11.0:
12691279
vc_config = 'LIB ' + vc_config
12701280
# monkey-patch project files, because
@@ -1277,12 +1287,12 @@ def spawn(command):
12771287
'{config}|{platform}'.format(config=vc_config,
12781288
platform='x64' if X64 else 'Win32')
12791289
])
1280-
postfix = '_D' if cmd.debug else ''
1290+
postfix += '_D' if cmd.debug else ''
12811291
builddir = os.path.join(src_path, 'objs', 'win32', vc)
12821292
else:
12831293
spawn(['msbuild', ftproj + '.sln', '/m', '/t:Clean;Build',
12841294
'/toolsversion:{}'.format(get_build_version()),
1285-
('/p:Configuration="{config}"'
1295+
('/p:Configuration={config}'
12861296
';Platform={platform}'
12871297
';VisualStudioVersion={version}'
12881298
';ToolsVersion={version}'
@@ -1291,7 +1301,7 @@ def spawn(command):
12911301
version=get_build_version(),
12921302
toolset=int(get_build_version() * 10)),
12931303
])
1294-
postfix = 'd' if cmd.debug else ''
1304+
postfix += 'd' if cmd.debug else ''
12951305
builddir = os.path.join(src_path, 'objs', vc, vc_platform)
12961306

12971307
verstr = LOCAL_FREETYPE_VERSION.replace('.', '')

0 commit comments

Comments
 (0)