summaryrefslogtreecommitdiff
path: root/modules/regex
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2018-09-28 13:29:52 +0200
committerRémi Verschelde <rverschelde@gmail.com>2018-09-28 14:07:39 +0200
commit3a2ca68af3c8bafe9f60f09bd8fece894fe3a925 (patch)
treec33aa8ccee82b26d868fbc91abed94e2480864c2 /modules/regex
parent243bdc4524ddcf8ac6bef03c378e14fe7bb263b8 (diff)
SCons: Build thirdparty code in own env, disable warnings
Also remove unnecessary `Export('env')` in other SCsubs, Export should only be used when exporting *new* objects.
Diffstat (limited to 'modules/regex')
-rw-r--r--modules/regex/SCsub17
1 files changed, 12 insertions, 5 deletions
diff --git a/modules/regex/SCsub b/modules/regex/SCsub
index 4b8d5e9283..99c25add45 100644
--- a/modules/regex/SCsub
+++ b/modules/regex/SCsub
@@ -4,15 +4,16 @@ Import('env')
Import('env_modules')
env_regex = env_modules.Clone()
-env_regex.Append(CPPFLAGS=["-DPCRE2_CODE_UNIT_WIDTH=0"])
-env_regex.add_source_files(env.modules_sources, "*.cpp")
if env['builtin_pcre2']:
jit_blacklist = ['javascript', 'uwp']
+
thirdparty_dir = '#thirdparty/pcre2/src/'
thirdparty_flags = ['-DPCRE2_STATIC', '-DHAVE_CONFIG_H']
+
if 'platform' in env and env['platform'] not in jit_blacklist:
thirdparty_flags.append('-DSUPPORT_JIT')
+
thirdparty_sources = [
"pcre2_auto_possess.c",
"pcre2_chartables.c",
@@ -42,15 +43,21 @@ if env['builtin_pcre2']:
"pcre2_valid_utf.c",
"pcre2_xclass.c",
]
+
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
+
env_regex.Append(CPPPATH=[thirdparty_dir])
env_regex.Append(CPPFLAGS=thirdparty_flags)
+
def pcre2_builtin(width):
- env_pcre2 = env_modules.Clone()
+ env_pcre2 = env_regex.Clone()
+ env_pcre2.disable_warnings()
env_pcre2["OBJSUFFIX"] = "_" + width + env_pcre2["OBJSUFFIX"]
- env_pcre2.Append(CPPPATH=[thirdparty_dir])
env_pcre2.add_source_files(env.modules_sources, thirdparty_sources)
- env_pcre2.Append(CPPFLAGS=thirdparty_flags)
env_pcre2.Append(CPPFLAGS=["-DPCRE2_CODE_UNIT_WIDTH=" + width])
+
pcre2_builtin("16")
pcre2_builtin("32")
+
+env_regex.Append(CPPFLAGS=["-DPCRE2_CODE_UNIT_WIDTH=0"])
+env_regex.add_source_files(env.modules_sources, "*.cpp")