diff options
author | Conor Kennedy <conor.kennedy@arm.com> | 2022-10-13 15:32:02 +0100 |
---|---|---|
committer | Conor Kennedy <conor.kennedy@arm.com> | 2022-10-17 10:32:52 +0100 |
commit | b0d7e79c3c72c322c9fcb2503f03a11eec699529 (patch) | |
tree | 6b76058c31cbdd150eb9ce05338c66f740378b78 /scripts/cmake | |
parent | 8939d60d2afd98bb3a1a5ca551e89f0bc3bb0b39 (diff) | |
download | ml-embedded-evaluation-kit-b0d7e79c3c72c322c9fcb2503f03a11eec699529.tar.gz |
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 <conor.kennedy@arm.com>
Change-Id: I039d88a1099932978e00a711fe58d31a85d2cd06
Diffstat (limited to 'scripts/cmake')
-rw-r--r-- | scripts/cmake/tensorflow.cmake | 10 |
1 files changed, 7 insertions, 3 deletions
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} |