Skip to content

Commit ebe2a9a

Browse files
committed
CMake: use find_program() to look for bash
This is to fail early, during the configuration step, and not later, during the compilation step if bash is not installed. Compile tested with and without bash installed on OpenBSD 7.5 amd64.
1 parent 0889cfa commit ebe2a9a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cbmc/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ endif()
5757

5858
# bash completion
5959
if(NOT WIN32)
60+
find_program(BASH_PROGRAM bash REQUIRED)
6061
add_custom_command(OUTPUT "${CBMC_ROOT_DIR}/scripts/bash-autocomplete/cbmc.sh"
61-
COMMAND "${CBMC_ROOT_DIR}/scripts/bash-autocomplete/extract_switches.sh" "${CMAKE_CXX_COMPILER}"
62+
COMMAND "${BASH_PROGRAM}" "${CBMC_ROOT_DIR}/scripts/bash-autocomplete/extract_switches.sh" "${CMAKE_CXX_COMPILER}"
6263
DEPENDS $<TARGET_FILE:cbmc>
6364
)
6465
add_custom_target(cbmc.sh ALL

0 commit comments

Comments
 (0)