From f0887bc199b5fc4ad44cbf698744c42ef0ed2ea8 Mon Sep 17 00:00:00 2001 From: "Lukasz A.J. Wrona" Date: Sun, 13 Oct 2019 00:17:56 +0100 Subject: [PATCH] Use git bash when configuring CMake This way you don't have to use Cygwin on Windows to configure cbmc with CMake and allows you to use Windows's native CMake support (assuming git is installed). --- CMakeLists.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 238cc63bdb..c7604b0211 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,8 +28,15 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR # Enable lots of warnings set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wpedantic -Werror -Wno-deprecated-declarations -Wswitch-enum") elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") - # This would be the place to enable warnings for Windows builds, although - # config.inc doesn't seem to do that currently + # This would be the place to enable warnings for Windows builds, although + # config.inc doesn't seem to do that currently + + # Include Git Bash Environment (rqeuired for download_project (patch)) + find_package(Git) + if(GIT_FOUND) + get_filename_component(git_root ${GIT_EXECUTABLE} DIRECTORY) + set(ENV{PATH} "${git_root}\\..\\usr\\bin;$ENV{PATH}") + endif() endif() set(enable_cbmc_tests on CACHE BOOL "Whether CBMC tests should be enabled")