summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorlkarthee <lkarthee@users.noreply.github.com>2020-04-28 01:47:29 +0530
committerGitHub <noreply@github.com>2020-04-27 13:17:29 -0700
commit068f604394b07160654b1e9b829472f877cacfe9 (patch)
treeb0e3e8d1545872fdc2c40537d4a94188ed0844f4 /CMakeLists.txt
parent74afb7f8d86fc1cfd30eb1f4a74cd8139baa384f (diff)
downloadwabt-068f604394b07160654b1e9b829472f877cacfe9.tar.gz
wabt-068f604394b07160654b1e9b829472f877cacfe9.tar.bz2
wabt-068f604394b07160654b1e9b829472f877cacfe9.zip
Improve error message when python 3 not available - Fix for #1385 (#1392)
* making python optional for build. https://github.com/WebAssembly/wabt/issues/1385 * Show error message about skipping tests if python3 is not available * Skipping tests when Python 3.5 or above is not found.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt9
1 files changed, 7 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6f869bff..65f456bd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -464,6 +464,13 @@ if (NOT EMSCRIPTEN)
)
endif ()
+ # Python 3.5 is the version shipped in Ubuntu Xenial
+ find_package(PythonInterp 3.5)
+ if(BUILD_TESTS AND (NOT PYTHONINTERP_FOUND))
+ set(BUILD_TESTS OFF)
+ message(WARNING "Skipping tests. Python 3 is required for wabt testing. Please install python3 to run tests.")
+ endif()
+
find_package(Threads)
if (BUILD_TESTS)
if (NOT USE_SYSTEM_GTEST)
@@ -520,8 +527,6 @@ if (NOT EMSCRIPTEN)
set(USES_TERMINAL USES_TERMINAL)
endif ()
- # Python 3.5 is the version shipped in Ubuntu Xenial
- find_package(PythonInterp 3.5 REQUIRED)
# test running
set(RUN_TESTS_PY ${WABT_SOURCE_DIR}/test/run-tests.py)