Skip to content

Commit

Permalink
CMake: use find_program() to look for bash
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
guijan committed May 10, 2024
1 parent 0889cfa commit ebe2a9a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cbmc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ endif()

# bash completion
if(NOT WIN32)
find_program(BASH_PROGRAM bash REQUIRED)
add_custom_command(OUTPUT "${CBMC_ROOT_DIR}/scripts/bash-autocomplete/cbmc.sh"
COMMAND "${CBMC_ROOT_DIR}/scripts/bash-autocomplete/extract_switches.sh" "${CMAKE_CXX_COMPILER}"
COMMAND "${BASH_PROGRAM}" "${CBMC_ROOT_DIR}/scripts/bash-autocomplete/extract_switches.sh" "${CMAKE_CXX_COMPILER}"
DEPENDS $<TARGET_FILE:cbmc>
)
add_custom_target(cbmc.sh ALL
Expand Down

0 comments on commit ebe2a9a

Please sign in to comment.