commit 849b9eebc199250642d25dad18e652d7a044a80b
parent f602bab6f6681a8b55d30cc636f1fe1f81e4dbf6
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Thu, 2 Sep 2021 16:08:35 +0300
configure: limit number of CPU cores used without heavy testing
Diffstat:
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
@@ -2478,8 +2478,20 @@ AC_MSG_RESULT($use_gcov)
AM_CONDITIONAL([USE_COVERAGE], [test "x$use_gcov" = "xyes"])
AX_COUNT_CPUS
-AS_IF([[test "$CPU_COUNT" -gt "32"]], [[CPU_COUNT="32"]])dnl Limit resource usage
-AC_SUBST([CPU_COUNT])
+AC_MSG_CHECKING([for number of CPU cores to use in tests])
+AS_VAR_IF([enable_heavy_tests], ["yes"],
+ [
+ # Enable usage of many core if heavy tests are enabled
+ AS_IF([[test "$CPU_COUNT" -gt "32"]], [[CPU_COUNT="32"]])dnl Limit resource usage
+ ],
+ [
+ # Limit usage to just a few cores if heavy tests are not enabled
+ AS_IF([[test "$CPU_COUNT" -gt "6"]], [[CPU_COUNT="6"]])
+ AS_IF([[test "$CPU_COUNT" -lt "2"]], [[CPU_COUNT="2"]])
+ ]
+)
+AC_MSG_RESULT(["$CPU_COUNT"])
+
AC_MSG_CHECKING([[whether to enable debug asserts]])
AC_ARG_ENABLE([[asserts]],