Skip to content

Commit cd0abb2

Browse files
authored
box2d doesn't need c++ exceptions or rtti, disabling them shrinks it by 15% [ci skip] (emscripten-core#6417)
1 parent c92a372 commit cd0abb2

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

tests/box2d/Benchmark.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ typedef struct {
1919
} result_t;
2020
// ==============================
2121

22-
23-
2422
#include <cstdio>
2523
#include <time.h>
2624
#include <math.h>
@@ -29,6 +27,10 @@ typedef struct {
2927
#include <emscripten.h>
3028
#endif
3129

30+
#if NO_PRINTING
31+
#define printf(fmt, ...) (0)
32+
#endif
33+
3234
#include "Box2D/Box2D.h"
3335

3436
using namespace std;

tests/box2d/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ OBJECTS = \
5151
all: box2d.a
5252

5353
%.o: %.cpp
54-
$(CXX) $(CFLAGS) -I. $< -o $@ -O2 -c
54+
$(CXX) $(CFLAGS) -I. $< -o $@ -O2 -c -fno-exceptions -fno-rtti
5555

5656
box2d.a: $(OBJECTS)
5757
$(AR) rvs $@ $(OBJECTS)

0 commit comments

Comments
 (0)