Skip to content

Fix up the Windows CMake build #1639

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions COMPILING.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ using "make generated_files" before opening the project.
There is an experimental build based on CMake instead of hand-written
makefiles. It should work on a wider variety of systems than the standard
makefile build, and can integrate better with IDEs and static-analysis tools.
On Windows, the CMake build does not depend on Cygwin or MinGW, and doesn't
require manual modification of build files.

1. Ensure you have all the build dependencies installed. Build dependencies are
the same as for the makefile build, but with the addition of CMake version
Expand All @@ -196,9 +198,15 @@ makefile build, and can integrate better with IDEs and static-analysis tools.
```
You shoud also install [Homebrew](https://brew.sh), after which you can
run `brew install cmake` to install CMake.
- On Windows, install Cygwin, then from the Cygwin setup facility install
`cmake`, `flex`, `bison`, `tar`, `gzip`, `git`, `make`, `wget`, and
`patch`.
- On Windows, ensure you have Visual Studio 2013 or later installed.
Then, download CMake from the [official download
page](https://cmake.org/download).
You'll also need `git` and `patch`, which are both provided by the
[git for Windows](git-scm.com/download/win) package.
Finally, Windows builds of flex and bison should be installed from
[the sourceforge page](sourceforge.net/projects/winflexbison).
The easiest way to 'install' these executables is to unzip them and to
drop the entire unzipped package into the CBMC source directory.
- Use of CMake has not been tested on Solaris or FreeBSD. However, it should
be possible to install CMake from the system package manager or the
[official download page](https://cmake.org/download) on those systems.
Expand Down
20 changes: 8 additions & 12 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,14 @@ install:
md deps
}
cd deps
if (!(Test-Path bin\bison.exe)) {
& 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"
& 7z x bison-2.4.1-bin.zip
}
if (!(Test-Path bin\flex.exe)) {
& 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"
& 7z x flex-2.5.4a-1-bin.zip
}
if (!(Test-Path include\FlexLexer.h)) {
& 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"
& 7z x flex-2.5.4a-1-lib.zip
}
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"
7z x win_flex_bison-latest.zip
Move-Item win_bison.exe bin\bison.exe -force
Move-Item win_flex.exe bin\flex.exe -force
Move-Item FlexLexer.h include\FlexLexer.h -force
Move-Item data bin\data -force
bison -V
flex -V
if (!(Test-Path bin\iconv.exe)) {
& 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"
& 7z x libiconv-1.9.2-1-bin.zip
Expand Down
7 changes: 2 additions & 5 deletions src/assembler/scanner.l
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
%option nounput
%option noinput
%option nounistd
%option never-interactive

%{

#ifdef _WIN32
#define YY_NO_UNISTD_H
static int isatty(int) { return 0; }
#endif

#define PARSER assembler_parser
#define YYSTYPE unsigned
#undef ECHO
Expand Down
6 changes: 2 additions & 4 deletions src/jsil/scanner.l
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
%option nounput
%option noinput
%option nounistd
%option never-interactive
%option stack

%{
#ifdef _WIN32
#define YY_NO_UNISTD_H
static int isatty(int) { return 0; }
#endif

#include <util/expr.h>

Expand Down
6 changes: 2 additions & 4 deletions src/json/scanner.l
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@
%option 8bit nodefault
%option nounput
%option noinput
%option nounistd
%option never-interactive

%option noyywrap

%{
#ifdef _WIN32
#define YY_NO_UNISTD_H
static int isatty(int) { return 0; }
#endif

#define PARSER json_parser

Expand Down
6 changes: 2 additions & 4 deletions src/xmllang/scanner.l
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
%option 8bit nodefault
%option nounput
%option noinput
%option nounistd
%option never-interactive

%{
#ifdef _WIN32
#define YY_NO_UNISTD_H
static int isatty(int) { return 0; }
#endif

#include <cctype>
#include <cstring>
Expand Down
8 changes: 8 additions & 0 deletions unit/miniBDD_new.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class bdd_propt:public propt
literalt lor(literalt a, literalt b) override
{
UNREACHABLE;
return {};
}

literalt land(const bvt &bv) override
Expand Down Expand Up @@ -94,16 +95,19 @@ class bdd_propt:public propt
literalt lxor(const bvt &bv) override
{
UNREACHABLE;
return {};
}

literalt lnand(literalt a, literalt b) override
{
UNREACHABLE;
return {};
}

literalt lnor(literalt a, literalt b) override
{
UNREACHABLE;
return {};
}

literalt lequal(literalt a, literalt b) override
Expand All @@ -114,11 +118,13 @@ class bdd_propt:public propt
literalt limplies(literalt a, literalt b) override
{
UNREACHABLE;
return {};
}

literalt lselect(literalt a, literalt b, literalt c) override
{
UNREACHABLE;
return {};
}

void lcnf(const bvt &bv) override
Expand All @@ -144,11 +150,13 @@ class bdd_propt:public propt
resultt prop_solve() override
{
UNREACHABLE;
return {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come these are required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When this is built under CMake, MSVC 2013 complains about missing return statements. I think this file isn't build under the Makefile build, which is why we don't see the error in Appveyor

}

tvt l_get(literalt a) const override
{
UNREACHABLE;
return {};
}

expanding_vectort<mini_bddt> bdd_map;
Expand Down