Skip to content

Commit 4625f83

Browse files
authored
Fix lua/poppler/bullet benchmarks under native benchmarkers. NFC (#26294)
The native benchmarker doesn't seem to set CFLAGS which was causing these to crash.
1 parent 8b99732 commit 4625f83

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

test/test_benchmark.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def build(self, parent, filename, shared_args, emcc_args, native_args, native_ex
166166
shared_args = shared_args or []
167167
self.parent = parent
168168
if lib_builder:
169-
env = {'CC': self.cc, 'CXX': self.cxx, 'CXXFLAGS': "-Wno-c++11-narrowing"}
169+
env = {'CC': self.cc, 'CXX': self.cxx, 'CXXFLAGS': '-Wno-c++11-narrowing'}
170170
env.update(clang_native.get_clang_native_env())
171171
native_args = native_args + lib_builder(self.name, native=True, env_init=env)
172172
if not native_exec:
@@ -312,7 +312,7 @@ def build(self, parent, filename, shared_args, emcc_args, native_args, native_ex
312312
'NM': CHEERP_BIN + 'llvm-nm',
313313
'LDSHARED': CHEERP_BIN + 'clang',
314314
'RANLIB': CHEERP_BIN + '../libexec/cheerp-unknown-none-ranlib',
315-
'CXXFLAGS': "-Wno-c++11-narrowing",
315+
'CXXFLAGS': '-Wno-c++11-narrowing',
316316
'CHEERP_PREFIX': CHEERP_BIN + '../',
317317
})
318318
if PROFILING:
@@ -980,7 +980,7 @@ def lua(self, benchmark, expected, output_parser=None):
980980

981981
def lib_builder(name, native, env_init):
982982
# Inject -sMEMORY64 into node-64 benchmarking runs.
983-
env_init['MYCFLAGS'] = env_init['CFLAGS']
983+
env_init['MYCFLAGS'] = env_init.get('CFLAGS', '')
984984
if '-sMEMORY64' in env_init['MYCFLAGS']:
985985
env_init['MYLDFLAGS'] = '-sMEMORY64'
986986

@@ -1041,7 +1041,7 @@ def test_zzz_bullet(self):
10411041
src += read_file(test_file('third_party/bullet/Demos/Benchmarks/main.cpp'))
10421042

10431043
def lib_builder(name, native, env_init):
1044-
cflags = ' '.join(self.cflags) + ' ' + env_init['CFLAGS']
1044+
cflags = ' '.join(self.cflags) + ' ' + env_init.get('CFLAGS', '')
10451045
return self.get_library(str(Path('third_party/bullet')),
10461046
['src/BulletDynamics/libBulletDynamics.a',
10471047
'src/BulletCollision/libBulletCollision.a',
@@ -1111,7 +1111,7 @@ def test_zzz_poppler(self):
11111111
''' % DEFAULT_ARG)
11121112

11131113
def lib_builder(name, native, env_init): # noqa
1114-
if '-sMEMORY64' in env_init['CFLAGS']:
1114+
if '-sMEMORY64' in env_init.get('CFLAGS', ''):
11151115
env_init['CPPFLAGS'] = '-sMEMORY64'
11161116
env_init['LDFLAGS'] = '-sMEMORY64'
11171117
return self.get_poppler_library(env_init=env_init)

0 commit comments

Comments
 (0)