From b0d7e79c3c72c322c9fcb2503f03a11eec699529 Mon Sep 17 00:00:00 2001 From: Conor Kennedy Date: Thu, 13 Oct 2022 15:32:02 +0100 Subject: MLECO-3575: Add option to manually set PARALLEL_JOBS for build * Check CMAKE_BUILD_PARALLEL_LEVEL and use this option to set the value of PARALLEL_JOBS Signed-off-by: Conor Kennedy Change-Id: I039d88a1099932978e00a711fe58d31a85d2cd06 --- scripts/cmake/tensorflow.cmake | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/cmake/tensorflow.cmake b/scripts/cmake/tensorflow.cmake index 24227d9..c63556d 100644 --- a/scripts/cmake/tensorflow.cmake +++ b/scripts/cmake/tensorflow.cmake @@ -15,8 +15,12 @@ # limitations under the License. #---------------------------------------------------------------------------- -include(ProcessorCount) -ProcessorCount(J) +if (DEFINED ENV{CMAKE_BUILD_PARALLEL_LEVEL}) + set(PARALLEL_JOBS $ENV{CMAKE_BUILD_PARALLEL_LEVEL}) +else() + include(ProcessorCount) + ProcessorCount(PARALLEL_JOBS) +endif() if (CMAKE_BUILD_TYPE STREQUAL Debug) set(TENSORFLOW_LITE_MICRO_CORE_OPTIMIZATION_LEVEL "-O0") @@ -89,7 +93,7 @@ add_custom_target(tensorflow_build ALL # Command to build the TensorFlow Lite Micro library COMMAND ${CMAKE_COMMAND} -E env PATH=${ENV_PATH} - make -j${J} -f ${TENSORFLOW_LITE_MICRO_PATH}/tools/make/Makefile ${MAKE_TARGETS_LIST} + make -j${PARALLEL_JOBS} -f ${TENSORFLOW_LITE_MICRO_PATH}/tools/make/Makefile ${MAKE_TARGETS_LIST} TARGET_TOOLCHAIN_ROOT=${TENSORFLOW_LITE_MICRO_TARGET_TOOLCHAIN_ROOT} TOOLCHAIN=${TENSORFLOW_LITE_MICRO_TOOLCHAIN} GENDIR=${TENSORFLOW_LITE_MICRO_GENDIR} -- cgit v1.2.1