Skip to content

Commit f17428a

Browse files
SebastianBoenashif
authored andcommitted
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 <[email protected]>
1 parent 768a30c commit f17428a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,10 @@ if(CONFIG_ARM AND CONFIG_USERSPACE)
812812
)
813813
add_custom_target(priv_stacks DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${PRIV_STACKS})
814814

815+
if(${GPERF} STREQUAL GPERF-NOTFOUND)
816+
message(FATAL_ERROR "Unable to find gperf")
817+
endif()
818+
815819
# Use gperf to generate C code (PRIV_STACKS_OUTPUT_SRC_PRE) which implements a
816820
# perfect hashtable based on PRIV_STACKS
817821
add_custom_command(

cmake/host-tools.cmake

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,11 @@ if(${CMAKE_MATCH_1} VERSION_LESS ${MIN_DTC_VERSION})
7575
endif()
7676
endif(DTC)
7777

78+
# gperf is an optional dependency
7879
find_program(
7980
GPERF
8081
gperf
8182
)
82-
if(${GPERF} STREQUAL GPERF-NOTFOUND)
83-
message(FATAL_ERROR "Unable to find gperf")
84-
endif()
8583

8684
# openocd is an optional dependency
8785
find_program(

0 commit comments

Comments
 (0)