| Index: compile |
| =================================================================== |
| --- a/compile |
| +++ b/compile |
| @@ -1,26 +1,27 @@ |
| #!/usr/bin/env python |
| import os |
| import re |
| import subprocess |
| -EMSCRIPTEN_PATH = '../emscripten' |
| -SOURCE_DIR = './compiled' |
| +BASE_DIR = os.path.dirname(__file__) or os.getcwd() |
|
Vasily Kuznetsov
2017/03/21 18:01:42
BASE_DIR (which I suppose is the path to the direc
Wladimir Palant
2017/03/22 08:44:20
It's fine to have relative paths for almost all pu
Vasily Kuznetsov
2017/03/22 09:52:58
I guess I'm missing some part of the picture here.
Wladimir Palant
2017/03/22 14:59:29
See SHELL_FILE key in GENERATION_PARAMS below. It
Vasily Kuznetsov
2017/03/22 19:16:01
Ah, ok, now I get it. But then we don't really nee
Wladimir Palant
2017/03/23 11:55:28
Fair enough, I verified that os.path.join('', 'foo
|
| +EMSCRIPTEN_PATH = os.path.join(BASE_DIR, '..', 'emscripten') |
| +SOURCE_DIR = os.path.join(BASE_DIR, 'compiled') |
| SOURCE_FILES = [ |
| os.path.join(path, f) |
| for (path, dirs, files) in os.walk(SOURCE_DIR) |
| for f in files |
| if f.endswith('.cpp') |
| ] |
| BINDINGS_FILE = os.path.join(SOURCE_DIR, 'bindings.cpp') |
| BINDINGS_GENERATOR = os.path.join(SOURCE_DIR, 'bindings.cpp.js') |
| BINDINGS_OUTPUT = os.path.join(SOURCE_DIR, 'bindings.js') |
| -COMPILER_OUTPUT = './lib/compiled.js' |
| +COMPILER_OUTPUT = os.path.join(BASE_DIR, 'lib', 'compiled.js') |
| GENERATION_PARAMS = { |
| 'SHELL_FILE': "'%s'" % os.path.abspath(os.path.join(SOURCE_DIR, |
| 'shell.js')), |
| 'ASM_JS': 2, # "almost asm" |
| 'TOTAL_MEMORY': 16*1024*1024, |
| 'TOTAL_STACK': 1*1024*1024, |
| 'ALLOW_MEMORY_GROWTH': 1, |
| 'NO_EXIT_RUNTIME': 1, |