Add support for building Binaryen with Visual Studio static analyzer.
This commit is contained in:
22
emsdk
22
emsdk
@@ -51,8 +51,8 @@ CMAKE_BUILD_TYPE_OVERRIDE = None
|
|||||||
# If true, perform a --shallow clone of git.
|
# 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.
|
# If true, LLVM backend is built with tests enabled, and Binaryen is built with Visual Studio static analyzer enabled.
|
||||||
BUILD_LLVM_TESTS = False
|
BUILD_FOR_TESTING = False
|
||||||
|
|
||||||
# If 'auto', assertions are decided by the build type (Release&MinSizeRel=disabled, Debug&RelWithDebInfo=enabled)
|
# If 'auto', assertions are decided by the build type (Release&MinSizeRel=disabled, Debug&RelWithDebInfo=enabled)
|
||||||
# Other valid values are 'ON' and 'OFF'
|
# Other valid values are 'ON' and 'OFF'
|
||||||
@@ -724,8 +724,8 @@ def build_fastcomp_tool(tool):
|
|||||||
build_type = decide_cmake_build_type(tool)
|
build_type = decide_cmake_build_type(tool)
|
||||||
|
|
||||||
# Configure
|
# Configure
|
||||||
global BUILD_LLVM_TESTS, ENABLE_LLVM_ASSERTIONS
|
global BUILD_FOR_TESTING, ENABLE_LLVM_ASSERTIONS
|
||||||
tests_arg = 'ON' if BUILD_LLVM_TESTS else 'OFF'
|
tests_arg = 'ON' if BUILD_FOR_TESTING else 'OFF'
|
||||||
|
|
||||||
enable_assertions = ENABLE_LLVM_ASSERTIONS.lower() == 'on' or (ENABLE_LLVM_ASSERTIONS == 'auto' and build_type.lower() != 'release' and build_type.lower() != 'minsizerel')
|
enable_assertions = ENABLE_LLVM_ASSERTIONS.lower() == 'on' or (ENABLE_LLVM_ASSERTIONS == 'auto' and build_type.lower() != 'release' and build_type.lower() != 'minsizerel')
|
||||||
|
|
||||||
@@ -806,10 +806,14 @@ def build_binaryen_tool(tool):
|
|||||||
build_type = decide_cmake_build_type(tool)
|
build_type = decide_cmake_build_type(tool)
|
||||||
|
|
||||||
# Configure
|
# Configure
|
||||||
|
args = []
|
||||||
|
|
||||||
cmake_generator = CMAKE_GENERATOR
|
cmake_generator = CMAKE_GENERATOR
|
||||||
if 'Visual Studio' in CMAKE_GENERATOR and tool.bitness == 64:
|
if 'Visual Studio' in CMAKE_GENERATOR:
|
||||||
cmake_generator += ' Win64'
|
if tool.bitness == 64: cmake_generator += ' Win64'
|
||||||
success = cmake_configure(cmake_generator, build_root, src_root, build_type)
|
if BUILD_FOR_TESTING: args += ['-DRUN_STATIC_ANALYZER=1']
|
||||||
|
|
||||||
|
success = cmake_configure(cmake_generator, build_root, src_root, build_type, args)
|
||||||
if not success: return False
|
if not success: return False
|
||||||
|
|
||||||
# Make
|
# Make
|
||||||
@@ -1721,7 +1725,7 @@ def silentremove(filename):
|
|||||||
if e.errno != errno.ENOENT: raise
|
if e.errno != errno.ENOENT: raise
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
global emscripten_config_directory, BUILD_LLVM_TESTS, ENABLE_LLVM_ASSERTIONS
|
global emscripten_config_directory, BUILD_FOR_TESTING, ENABLE_LLVM_ASSERTIONS
|
||||||
load_dot_emscripten()
|
load_dot_emscripten()
|
||||||
load_sdk_manifest()
|
load_sdk_manifest()
|
||||||
|
|
||||||
@@ -1995,7 +1999,7 @@ def main():
|
|||||||
GIT_CLONE_SHALLOW = True
|
GIT_CLONE_SHALLOW = True
|
||||||
sys.argv[i] = ''
|
sys.argv[i] = ''
|
||||||
elif sys.argv[i] == '--build-tests':
|
elif sys.argv[i] == '--build-tests':
|
||||||
BUILD_LLVM_TESTS = True
|
BUILD_FOR_TESTING = True
|
||||||
sys.argv[i] = ''
|
sys.argv[i] = ''
|
||||||
elif sys.argv[i] == '--enable-assertions':
|
elif sys.argv[i] == '--enable-assertions':
|
||||||
ENABLE_LLVM_ASSERTIONS = 'ON'
|
ENABLE_LLVM_ASSERTIONS = 'ON'
|
||||||
|
|||||||
Reference in New Issue
Block a user