summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-05-02 08:14:28 +0200
committerGitHub <noreply@github.com>2019-05-02 08:14:28 +0200
commitc2c56ee3975ec9744088d5328462818a5980a5a0 (patch)
tree07a26cee1f66725231319bff3529498c9a4b33ef /modules
parent476c3be471b3a27884184572e5252403be78587e (diff)
parent4f9408a0f8b15d7822057296f932d69a6a4611e2 (diff)
Merge pull request #28576 from Faless/build/js_freetype_pr
Freetype clone env for no-SMID single file
Diffstat (limited to 'modules')
-rw-r--r--modules/freetype/SCsub17
1 files changed, 10 insertions, 7 deletions
diff --git a/modules/freetype/SCsub b/modules/freetype/SCsub
index 0c8b223a9e..0ea581220e 100644
--- a/modules/freetype/SCsub
+++ b/modules/freetype/SCsub
@@ -61,13 +61,6 @@ if env['builtin_freetype']:
# Globally too, as freetype is used in scene (see bottom)
env.Append(CCFLAGS=['/FI', '"modules/freetype/uwpdef.h"'])
- sfnt = thirdparty_dir + 'src/sfnt/sfnt.c'
- if env['platform'] == 'javascript':
- # Forcibly undefine this macro so SIMD is not used in this file,
- # since currently unsupported in WASM
- sfnt = env_freetype.Object(sfnt, CPPFLAGS=['-U__OPTIMIZE__'])
- thirdparty_sources += [sfnt]
-
env_freetype.Prepend(CPPPATH=[thirdparty_dir + "/include"])
# Also needed in main env for scene/
env.Prepend(CPPPATH=[thirdparty_dir + "/include"])
@@ -80,6 +73,16 @@ if env['builtin_freetype']:
if env['builtin_libpng']:
env_freetype.Prepend(CPPPATH=["#thirdparty/libpng"])
+ sfnt = thirdparty_dir + 'src/sfnt/sfnt.c'
+ # Must be done after all CPPFLAGS are being set so we can copy them.
+ if env['platform'] == 'javascript':
+ # Forcibly undefine this macro so SIMD is not used in this file,
+ # since currently unsupported in WASM
+ tmp_env = env_freetype.Clone()
+ tmp_env.Append(CPPFLAGS=['-U__OPTIMIZE__'])
+ sfnt = tmp_env.Object(sfnt)
+ thirdparty_sources += [sfnt]
+
env_thirdparty = env_freetype.Clone()
env_thirdparty.disable_warnings()
lib = env_thirdparty.add_library("freetype_builtin", thirdparty_sources)