cmake: Have gperf be opt-out instead of mandatory

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 <sebastian.boe@nordicsemi.no>
This commit is contained in:
Sebastian Bøe 2020-01-29 15:39:33 +01:00 committed by Anas Nashif
commit f17428a009
2 changed files with 5 additions and 3 deletions

View file

@ -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(

View file

@ -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(