diff options
author | Graham Bloice <graham.bloice@trihedral.com> | 2016-01-02 21:41:00 +0000 |
---|---|---|
committer | Graham Bloice <graham.bloice@trihedral.com> | 2016-01-02 22:59:03 +0000 |
commit | 40a21c0236d1ad373c42f130ace0bc5873fea373 (patch) | |
tree | 7bbc28cbe4ca0aab1cc5973659cd4b264c826e95 /cmake/modules | |
parent | 3866df04dda2ee11ef8d0c21f980a95977f793fe (diff) |
Build: On Windows, ensure we have found Cygwin bash
git can be installed (or the path manually set) so that the msys
unix utilities supplied with git (expecially bash) are on the path
and then picked up by CMake. These utilities are not compatible with
the build and will fail.
This change checks the output of the --version option to the found
executable and ensures "cygwin" is found in the result. If not found
a FATAL_ERROR message is issued and the CMake generation is stopped.
Change-Id: I0eca014ae194862abbc8dee56d347526691e72cb
Reviewed-on: https://code.wireshark.org/review/13008
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Diffstat (limited to 'cmake/modules')
-rw-r--r-- | cmake/modules/FindSH.cmake | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/cmake/modules/FindSH.cmake b/cmake/modules/FindSH.cmake index 75867af495..430d11741e 100644 --- a/cmake/modules/FindSH.cmake +++ b/cmake/modules/FindSH.cmake @@ -19,9 +19,15 @@ find_program( SH_EXECUTABLE include( FindPackageHandleStandardArgs ) find_package_handle_standard_args( SH DEFAULT_MSG SH_EXECUTABLE ) -# FIXME: Don't match on the name but check whether the argument is -# accepted or not. OTOH, if it isn't accepted, build will fail on Win. +# Ensure this is Cygwin bash if( WIN32 ) + execute_process( COMMAND ${SH_EXECUTABLE} --version OUTPUT_VARIABLE SH_VERSION ) + string( FIND "${SH_VERSION}" "cygwin" SH_IS_CYGWIN ) + if( ${SH_IS_CYGWIN} LESS 0 ) + set( BAD_SH ${SH_EXECUTABLE} ) + unset( SH_EXECUTABLE CACHE ) + message( FATAL_ERROR "The bash executable (${BAD_SH}) isn't from Cygwin. Check your path" ) + endif() set( SH_FLAGS1 -o ) set( SH_FLAGS2 igncr ) endif() |