diff options
Diffstat (limited to 'tools/shared.py')
-rw-r--r-- | tools/shared.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/shared.py b/tools/shared.py index b5ae1ae1..7570473c 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -139,6 +139,11 @@ except: print 'ERROR: %s does not seem to have JS_ENGINES or JS_ENGINE set up' % EM_CONFIG raise +try: + CLOSURE_COMPILER +except: + CLOSURE_COMPILER = path_from_root('third_party', 'closure-compiler', 'compiler.jar') + # Additional compiler options try: @@ -607,11 +612,10 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)''' \ if unsafe: if not Building.can_inline(): opts.append('-disable-inlining') - # -Ox opts do -globaldce, which removes stuff that is needed for libraries and linkables - if Building.can_build_standalone(): - opts.append('-O%d' % optimization_level) - else: - opts.append('-std-compile-opts') + if not Building.can_build_standalone(): + # -O1 does not have -gobaldce, which removes stuff that is needed for libraries and linkables + optimization_level = min(1, optimization_level) + opts.append('-O%d' % optimization_level) #print '[unsafe: %s]' % ','.join(opts) else: allow_nonportable = False |