Skip to content

Commit 0393027

Browse files
authored
Merge pull request #1639 from reuk/reuk/windows-fixes
Fix up the Windows CMake build
2 parents 1667307 + 6c3fb17 commit 0393027

File tree

7 files changed

+35
-32
lines changed

7 files changed

+35
-32
lines changed

COMPILING.md

+11-3
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ using "make generated_files" before opening the project.
177177
There is an experimental build based on CMake instead of hand-written
178178
makefiles. It should work on a wider variety of systems than the standard
179179
makefile build, and can integrate better with IDEs and static-analysis tools.
180+
On Windows, the CMake build does not depend on Cygwin or MinGW, and doesn't
181+
require manual modification of build files.
180182
181183
1. Ensure you have all the build dependencies installed. Build dependencies are
182184
the same as for the makefile build, but with the addition of CMake version
@@ -196,9 +198,15 @@ makefile build, and can integrate better with IDEs and static-analysis tools.
196198
```
197199
You shoud also install [Homebrew](https://brew.sh), after which you can
198200
run `brew install cmake` to install CMake.
199-
- On Windows, install Cygwin, then from the Cygwin setup facility install
200-
`cmake`, `flex`, `bison`, `tar`, `gzip`, `git`, `make`, `wget`, and
201-
`patch`.
201+
- On Windows, ensure you have Visual Studio 2013 or later installed.
202+
Then, download CMake from the [official download
203+
page](https://cmake.org/download).
204+
You'll also need `git` and `patch`, which are both provided by the
205+
[git for Windows](git-scm.com/download/win) package.
206+
Finally, Windows builds of flex and bison should be installed from
207+
[the sourceforge page](sourceforge.net/projects/winflexbison).
208+
The easiest way to 'install' these executables is to unzip them and to
209+
drop the entire unzipped package into the CBMC source directory.
202210
- Use of CMake has not been tested on Solaris or FreeBSD. However, it should
203211
be possible to install CMake from the system package manager or the
204212
[official download page](https://cmake.org/download) on those systems.

appveyor.yml

+8-12
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,14 @@ install:
1212
md deps
1313
}
1414
cd deps
15-
if (!(Test-Path bin\bison.exe)) {
16-
& appveyor DownloadFile "https://storage.googleapis.com/diffblue-mirror/appveyor-deps/bison-2.4.1-bin.zip?GoogleAccessId=diffbluemaster@diffblue-cr.iam.gserviceaccount.com&Expires=1519839050&Signature=JAPFzNPMJDI4IViAVlJAEc6l8aHB3k17NpZRdoWDMLbALaJNX88vfwocuezU1tfhyrSJxfo2fTK4rgP5OULkikJs7MBZI9ovp2V%2BMT6yg87KDdH9EIOlMgltGfbP%2BoZkwBY7kXb3W5puSlt4OTE%2Bw7CRlHF9MNqFXVBqVBfa%2BGw0gXDe5Jd9qV%2BvUXZzRuBl9ERSQkSD%2B%2B%2BxFo24FZoOeYkgBHJz03%2BHuIMnlmcLgneTB2aiZZU3%2B6UTPceUxLus9%2Bksb5UbqEVaVE06TIXl76VKwqAgXM2LWaNyeJDog%2BT%2BhjW4v4ypxh6mIBo5KRNXVLPc1MxSPFQB3ITlIXv9Zg%3D%3D"
17-
& 7z x bison-2.4.1-bin.zip
18-
}
19-
if (!(Test-Path bin\flex.exe)) {
20-
& appveyor DownloadFile "https://storage.googleapis.com/diffblue-mirror/appveyor-deps/flex-2.5.4a-1-bin.zip?GoogleAccessId=diffbluemaster@diffblue-cr.iam.gserviceaccount.com&Expires=1519839050&Signature=WriP8S047Mmq271ZHWL0MCPGx1gEFsuc%2BKMmChoXhXFRkn0GlIgCxZEiOu52ke9fT1kAvycWXePNBFAyCHjpF%2BJkXCwisQ6FLIf3NL%2F92849YgQKdJkDUOcZ%2Bh82XVTwNBrljKIkExkak7QEyhOf3buTC1oeuatCUV5Ez42RZjgtRiJaqcFW6xLbhfuVONr39KxH5hGx%2FDUi2RRXPbgoKDwavc9s56NP1rNbWMTE6NdNHzJeaf43E%2BSMemlVO%2BhhIY6W0f%2FtaQ7fYF%2F6YaqxdQ0sB8W5DnG4Hb%2F0CyQlrTZpGDXGr301rV0M4WBkYLmfauq4IyJsBaR095tXGW%2BzmA%3D%3D"
21-
& 7z x flex-2.5.4a-1-bin.zip
22-
}
23-
if (!(Test-Path include\FlexLexer.h)) {
24-
& appveyor DownloadFile "https://storage.googleapis.com/diffblue-mirror/appveyor-deps/flex-2.5.4a-1-lib.zip?GoogleAccessId=diffbluemaster@diffblue-cr.iam.gserviceaccount.com&Expires=1519839050&Signature=H%2FLeKGv2QqKAGDTP%2F6TYPhDzuL6K%2F5dFOt61HfYBm1vUWVUNmAYVGvUAcvnUqBnhEHwZgtc8vZt1H7k3W8azxCUc7l6ZhlCDbqQ6Mg2VhfpBaQMbL1V%2BjSq5ePpWcuLMBntKk2br38PF1NtiAwCCpRTRPptaYPeGs%2BOjAH%2BN8aIIxjvj45QAgt9mcg6dfBsyfj5fdJmpHRQFuJ7%2FnsG50fmN5JDvdvmBWloB6rjxVWaN4XO6VTWZFZ34JWFyOqgWNEw9aDN3HdsSuJ0Uz19AbdwZBIWe5Elrl71rRJjn1lijCknDB7D4sAmP33k71e%2BB0qvsNl1Shuh9FkY8Z6y05Q%3D%3D"
25-
& 7z x flex-2.5.4a-1-lib.zip
26-
}
15+
appveyor DownloadFile "https://storage.googleapis.com/diffblue-mirror/appveyor-deps/win_flex_bison-latest.zip?GoogleAccessId=diffbluemaster@diffblue-cr.iam.gserviceaccount.com&Expires=1543674503&Signature=CojdaOYrFl50gbxCQL%2BlfVtuo7j9v1OzfWD6jYIkfv1h7xzCacigAM51%2BVjaVx%2B8yvUjk%2B4MOU%2FKmLzev7dABWNi5n7p7SvlXYPFVVwDE57Me35Xi7BzW%2FhoSaPnVIGuhAmDfxjGoHhB0Of%2Fd2FfMl4cklGgc2YafTpFX3agNCE4dcc1UyG0SY5CbvTGTuBP%2B99zaQ69lNT1TSNUNp0PW2Hhj%2FPylts0IdDm713RA4wcNIHvLTTppBiNwMm0y%2B0qRG1op3R4vc5gahz%2B6dTUnCevYWO5l%2FIvmXQyo4XNkgqLKIRgk4wisLjtSuRh5vPyD%2FQPOrn2ubT53YnDcW6geA%3D%3D"
16+
7z x win_flex_bison-latest.zip
17+
Move-Item win_bison.exe bin\bison.exe -force
18+
Move-Item win_flex.exe bin\flex.exe -force
19+
Move-Item FlexLexer.h include\FlexLexer.h -force
20+
Move-Item data bin\data -force
21+
bison -V
22+
flex -V
2723
if (!(Test-Path bin\iconv.exe)) {
2824
& appveyor DownloadFile "https://storage.googleapis.com/diffblue-mirror/appveyor-deps/libiconv-1.9.2-1-bin.zip?GoogleAccessId=diffbluemaster@diffblue-cr.iam.gserviceaccount.com&Expires=1519839050&Signature=sS3Y2lC1oWOhBDsL8C9ASuO4LOM%2BpB%2F8PwG5w5CdB9JnPfLqhb3FnA1zkkZJoSNuIYS3DM6CN2qxoWjpJbLEtVQe0PpxziQZjLpJw2MpxXdJiJHRDu8x9THgzwuZ3ze5BWHzPoCBQPdRkKzVPezf1HwptUsm3Y9c2jlWljQjhc8NVsI4iPmjEOwT8E%2BYpR5fsLs2GsRjuoyqKa%2Bi4JJ6MbpXVX1IgR4fzp1Li9SnE39ujHDb%2FyI3c96eCdVm1Oa6jNxzSJNfq%2FgOZM8BIxlR55a%2BtM3oBQhU0voEtDOABwuO7ZBay8dLt%2FG5vz1%2Bi%2FIlRLFxQfICaprPLzw6pXRm8Q%3D%3D"
2925
& 7z x libiconv-1.9.2-1-bin.zip

src/assembler/scanner.l

100644100755
+2-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
%option nounput
22
%option noinput
3+
%option nounistd
4+
%option never-interactive
35

46
%{
57

6-
#ifdef _WIN32
7-
#define YY_NO_UNISTD_H
8-
static int isatty(int) { return 0; }
9-
#endif
10-
118
#define PARSER assembler_parser
129
#define YYSTYPE unsigned
1310
#undef ECHO

src/jsil/scanner.l

100644100755
+2-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
%option nounput
22
%option noinput
3+
%option nounistd
4+
%option never-interactive
35
%option stack
46

57
%{
6-
#ifdef _WIN32
7-
#define YY_NO_UNISTD_H
8-
static int isatty(int) { return 0; }
9-
#endif
108

119
#include <util/expr.h>
1210

src/json/scanner.l

100644100755
+2-4
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@
55
%option 8bit nodefault
66
%option nounput
77
%option noinput
8+
%option nounistd
9+
%option never-interactive
810

911
%option noyywrap
1012

1113
%{
12-
#ifdef _WIN32
13-
#define YY_NO_UNISTD_H
14-
static int isatty(int) { return 0; }
15-
#endif
1614

1715
#define PARSER json_parser
1816

src/xmllang/scanner.l

100644100755
+2-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
%option 8bit nodefault
22
%option nounput
33
%option noinput
4+
%option nounistd
5+
%option never-interactive
46

57
%{
6-
#ifdef _WIN32
7-
#define YY_NO_UNISTD_H
8-
static int isatty(int) { return 0; }
9-
#endif
108

119
#include <cctype>
1210
#include <cstring>

unit/miniBDD_new.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ class bdd_propt:public propt
6464
literalt lor(literalt a, literalt b) override
6565
{
6666
UNREACHABLE;
67+
return {};
6768
}
6869

6970
literalt land(const bvt &bv) override
@@ -94,16 +95,19 @@ class bdd_propt:public propt
9495
literalt lxor(const bvt &bv) override
9596
{
9697
UNREACHABLE;
98+
return {};
9799
}
98100

99101
literalt lnand(literalt a, literalt b) override
100102
{
101103
UNREACHABLE;
104+
return {};
102105
}
103106

104107
literalt lnor(literalt a, literalt b) override
105108
{
106109
UNREACHABLE;
110+
return {};
107111
}
108112

109113
literalt lequal(literalt a, literalt b) override
@@ -114,11 +118,13 @@ class bdd_propt:public propt
114118
literalt limplies(literalt a, literalt b) override
115119
{
116120
UNREACHABLE;
121+
return {};
117122
}
118123

119124
literalt lselect(literalt a, literalt b, literalt c) override
120125
{
121126
UNREACHABLE;
127+
return {};
122128
}
123129

124130
void lcnf(const bvt &bv) override
@@ -144,11 +150,13 @@ class bdd_propt:public propt
144150
resultt prop_solve() override
145151
{
146152
UNREACHABLE;
153+
return {};
147154
}
148155

149156
tvt l_get(literalt a) const override
150157
{
151158
UNREACHABLE;
159+
return {};
152160
}
153161

154162
expanding_vectort<mini_bddt> bdd_map;

0 commit comments

Comments
 (0)