From f17428a009c8fc544b6244bab951a153dff023eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Wed, 29 Jan 2020 15:39:33 +0100 Subject: [PATCH] cmake: Have gperf be opt-out instead of mandatory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gperf is only used when CONFIG_USERSPACE is enabled. Users that use arch's that don't support CONFIG_USERSPACE, or happen to not never enable CONFIG_USERSPACE should not be artificially required to install gperf. This change makes gperf optional by moving it's presence-check to it's usage. Signed-off-by: Sebastian Bøe --- CMakeLists.txt | 4 ++++ cmake/host-tools.cmake | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d4ac0716daf..c786770bee4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -812,6 +812,10 @@ if(CONFIG_ARM AND CONFIG_USERSPACE) ) add_custom_target(priv_stacks DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${PRIV_STACKS}) + if(${GPERF} STREQUAL GPERF-NOTFOUND) + message(FATAL_ERROR "Unable to find gperf") + endif() + # Use gperf to generate C code (PRIV_STACKS_OUTPUT_SRC_PRE) which implements a # perfect hashtable based on PRIV_STACKS add_custom_command( diff --git a/cmake/host-tools.cmake b/cmake/host-tools.cmake index 6858f2f3f82..3bd3e4fd9c3 100644 --- a/cmake/host-tools.cmake +++ b/cmake/host-tools.cmake @@ -75,13 +75,11 @@ if(${CMAKE_MATCH_1} VERSION_LESS ${MIN_DTC_VERSION}) endif() endif(DTC) +# gperf is an optional dependency find_program( GPERF gperf ) -if(${GPERF} STREQUAL GPERF-NOTFOUND) - message(FATAL_ERROR "Unable to find gperf") -endif() # openocd is an optional dependency find_program(