diff options
119 files changed, 17016 insertions, 1270 deletions
@@ -120,4 +120,9 @@ a license to everyone to use it as detailed in LICENSE.) * Jari Vetoniemi <mailroxas@gmail.com> * Sindre Sorhus <sindresorhus@gmail.com> * James S Urquhart <jamesu@gmail.com> +* Boris Gjenero <boris.gjenero@gmail.com> +* jonas echterhoff <jonas@unity3d.com> +* Sami Vaarala <sami.vaarala@iki.fi> * Jack A. Arrington <jack@epicpineapple.com> + + @@ -47,16 +47,18 @@ emcc can be influenced by a few environment variables: EMMAKEN_COMPILER - The compiler to be used, if you don't want the default clang. ''' -import os, sys, shutil, tempfile, subprocess, shlex, time, re, logging +import os, sys, shutil, tempfile, subprocess, shlex, time, re, logging, json from subprocess import PIPE, STDOUT -from tools import shared, jsrun +from tools import shared, jsrun, system_libs from tools.shared import Compression, execute, suffix, unsuffixed, unsuffixed_basename, WINDOWS from tools.response_file import read_response_file # endings = dot + a suffix, safe to test by filename.endswith(endings) C_ENDINGS = ('.c', '.C') CXX_ENDINGS = ('.cpp', '.cxx', '.cc', '.CPP', '.CXX', '.CC') -SOURCE_ENDINGS = C_ENDINGS + CXX_ENDINGS + ('.m', '.mm') +OBJC_ENDINGS = ('.m',) +OBJCXX_ENDINGS = ('.mm',) +SOURCE_ENDINGS = C_ENDINGS + CXX_ENDINGS + OBJC_ENDINGS + OBJCXX_ENDINGS BITCODE_ENDINGS = ('.bc', '.o', '.obj') DYNAMICLIB_ENDINGS = ('.dylib', '.so', '.dll') STATICLIB_ENDINGS = ('.a',) @@ -311,6 +313,13 @@ Options that are modified or new in %s include: If a directory is passed here, its entire contents will be embedded. + Note: Embedding files is much less + efficient than preloading them. You + should only use it for small amounts + of small files. Instead, use + --preload-file which emits efficient + binary data. + --preload-file <name> A file to preload before running the compiled code asynchronously. Otherwise similar to --embed-file, except that this @@ -384,6 +393,9 @@ Options that are modified or new in %s include: The main file resides in the base directory and has the suffix ".js". + Note: this option is deprecated (modern JS debuggers + should work ok even on large files) + --bind Compiles the source code using the "embind" bindings approach, which connects C/C++ and JS. @@ -704,7 +716,7 @@ use_cxx = True for i in range(1, len(sys.argv)): arg = sys.argv[i] if not arg.startswith('-'): - if arg.endswith(('.c','.m')): + if arg.endswith(C_ENDINGS + OBJC_ENDINGS): use_cxx = False if '-M' in sys.argv or '-MM' in sys.argv: @@ -841,7 +853,11 @@ try: requested_level = 2 settings_changes.append('INLINING_LIMIT=50') opt_level = validate_arg_level(requested_level, 3, 'Invalid optimization level: ' + newargs[i]) - newargs[i] = '' + # We leave the -O option in place so that the clang front-end runs in that + # optimization mode, but we disable the actual optimization passes, as we'll + # run them seperately. + newargs.append('-mllvm') + newargs.append('-disable-llvm-optzns' |