Add --build-tests command line option.

This commit is contained in:
Jukka Jylänki
2015-09-15 16:14:08 +03:00
parent 4f5cbc4ea8
commit aebcc04dc7

54
emsdk
View File

@@ -48,8 +48,12 @@ CPU_CORES = max(multiprocessing.cpu_count()-1, 1) # Don't saturate all cores to
CMAKE_BUILD_TYPE_OVERRIDE = None CMAKE_BUILD_TYPE_OVERRIDE = None
# If true, perform a --shallow clone of git.
GIT_CLONE_SHALLOW = False GIT_CLONE_SHALLOW = False
# If true, LLVM backend is built with tests enabled.
BUILD_LLVM_TESTS = False
emscripten_config_directory = os.path.expanduser("~/") emscripten_config_directory = os.path.expanduser("~/")
EMSDK_SET_ENV = 'emsdk_set_env.bat' if WINDOWS else 'emsdk_set_env.sh' EMSDK_SET_ENV = 'emsdk_set_env.bat' if WINDOWS else 'emsdk_set_env.sh'
@@ -607,8 +611,10 @@ def build_fastcomp_tool(tool):
build_type = decide_cmake_build_type(tool) build_type = decide_cmake_build_type(tool)
# Configure # Configure
success = cmake_configure(cmake_generator, build_root, fastcomp_src_root, build_type, ['-DLLVM_TARGETS_TO_BUILD=X86;JSBackend', global BUILD_LLVM_TESTS
'-DLLVM_INCLUDE_EXAMPLES=OFF', '-DLLVM_INCLUDE_TESTS=OFF', '-DCLANG_INCLUDE_EXAMPLES=OFF', '-DCLANG_INCLUDE_TESTS=OFF']) tests_arg = 'ON' if BUILD_LLVM_TESTS else 'OFF'
args = ['-DLLVM_TARGETS_TO_BUILD=X86;JSBackend', '-DLLVM_INCLUDE_EXAMPLES=OFF', '-DCLANG_INCLUDE_EXAMPLES=OFF', '-DLLVM_INCLUDE_TESTS=' + tests_arg, '-DCLANG_INCLUDE_TESTS=' + tests_arg]
success = cmake_configure(cmake_generator, build_root, fastcomp_src_root, build_type, args)
if not success: return False if not success: return False
# Make # Make
@@ -1452,23 +1458,35 @@ def main():
emsdk update - Fetches a list of updates from the net (but emsdk update - Fetches a list of updates from the net (but
does not install them) does not install them)
emsdk install [-j<num>] [--build=type] [--shallow] <tool 1> <tool 2> ... emsdk install [options] <tool 1> <tool 2> <tool 3> ...
- Downloads and installs given tools or SDKs. - Downloads and installs given tools or SDKs.
An optional -j<num> specifier can be used to Options can contain:
specify the number of cores to use when
building the tool. (default: use one less
than the # of detected cores)
When installing tools from one of the git -j<num>: Specifies the number of cores to use when
building the tool. Default: use one less
than the # of detected cores.
--build=<type>: Controls what kind of build of LLVM to
perform. Pass either 'Debug', 'Release',
'MinSizeRel' or 'RelWithDebInfo'. Default:
'Release' for LLVM master branch, and
'RelWithDebInfo' for LLVM incoming branch.
--shallow: When installing tools from one of the git
development branches 'master' or 'incoming', development branches 'master' or 'incoming',
you can specify the --shallow parameter this parameter can be passed to perform a
to perform a shallow git clone instead of a shallow git clone instead of a full one.
full one. This reduces the amount of network This reduces the amount of network transfer
transfer that is needed. This option should that is needed. This option should only be
only be used when you are interested in used when you are interested in downloading
downloading one of the development branches, one of the development branches, but are not
but are not looking to develop Emscripten looking to develop Emscripten yourself.
yourself. Default: disabled, i.e. do a full clone.
--build-tests: If enabled, LLVM is built with internal tests
included. Pass this to enable running test
other.test_llvm_lit in the Emscripten test
suite. Default: disabled.
emsdk uninstall <tool/sdk> - Removes the given tool or SDK from disk.''') emsdk uninstall <tool/sdk> - Removes the given tool or SDK from disk.''')
@@ -1683,6 +1701,10 @@ def main():
global GIT_CLONE_SHALLOW global GIT_CLONE_SHALLOW
GIT_CLONE_SHALLOW = True GIT_CLONE_SHALLOW = True
sys.argv[i] = '' sys.argv[i] = ''
elif sys.argv[i] == '--build-tests':
global BUILD_LLVM_TESTS
BUILD_LLVM_TESTS = True
sys.argv[i] = ''
sys.argv = [x for x in sys.argv if not len(x) == 0] sys.argv = [x for x in sys.argv if not len(x) == 0]
if len(sys.argv) <= 2: if len(sys.argv) <= 2:
print("Missing parameter. Type 'emsdk install <tool name>' to install a tool or an SDK. Type 'emsdk list' to obtain a list of available tools. Type 'emsdk install latest' to automatically install the newest version of the SDK.") print("Missing parameter. Type 'emsdk install <tool name>' to install a tool or an SDK. Type 'emsdk list' to obtain a list of available tools. Type 'emsdk install latest' to automatically install the newest version of the SDK.")