Disable FreeType SIMD in HTML5 builds

SIMD is currently unsupported in WebAssembly.

(cherry picked from commit 315983c90d)
This commit is contained in:
Leon Krause 2018-03-06 19:18:34 +01:00 committed by Hein-Pieter van Braam
parent 4fc6256010
commit b5a55810c5
1 changed files with 12 additions and 4 deletions

View File

@ -49,7 +49,6 @@ if env['builtin_freetype']:
"src/pshinter/pshinter.c", "src/pshinter/pshinter.c",
"src/psnames/psnames.c", "src/psnames/psnames.c",
"src/raster/raster.c", "src/raster/raster.c",
"src/sfnt/sfnt.c",
"src/smooth/smooth.c", "src/smooth/smooth.c",
"src/truetype/truetype.c", "src/truetype/truetype.c",
"src/type1/type1.c", "src/type1/type1.c",
@ -58,9 +57,18 @@ if env['builtin_freetype']:
] ]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
sfnt = thirdparty_dir + 'src/sfnt/sfnt.c'
if 'platform' in env:
if env['platform'] == 'uwp':
# Include header for UWP to fix build issues # Include header for UWP to fix build issues
if "platform" in env and env["platform"] == "uwp":
env.Append(CCFLAGS=['/FI', '"modules/freetype/uwpdef.h"']) env.Append(CCFLAGS=['/FI', '"modules/freetype/uwpdef.h"'])
elif env['platform'] == 'javascript':
# Forcibly undefine this macro so SIMD is not used in this file,
# since currently unsuported in WASM
sfnt = env.Object(sfnt, CPPFLAGS=['-U__OPTIMIZE__'])
thirdparty_sources += [sfnt]
env.Append(CPPPATH=[thirdparty_dir, thirdparty_dir + "/include"]) env.Append(CPPPATH=[thirdparty_dir, thirdparty_dir + "/include"])