Skip to content

Commit

Permalink
Build Z3 using CMake/Ninja
Browse files Browse the repository at this point in the history
Unfortunately, using a native Windows version of Python causes Z3's
`mk_make.py` script to generate a `Makefile` tailored specifically for Visual
Studio, which is annoying to deal with in GitHub Actions. We instead use Z3's
CMake/Ninja-based build, which avoids this.
  • Loading branch information
RyanGlScott committed Mar 14, 2023
1 parent c3556f9 commit 9204537
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,15 @@ build_z3-4.8.14() {
build_z3() {
Z3_BIN="z3-$1"
pushd repos/$Z3_BIN
mkdir build
cd build
if $IS_WIN ; then
sed -i.bak -e 's/STATIC_BIN=False/STATIC_BIN=True/' scripts/mk_util.py
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS:STRING='-static' -GNinja
else
cmake .. -DCMAKE_BUILD_TYPE=Release -GNinja
fi
python scripts/mk_make.py
(cd build && make -j4 && cp z3$EXT $BIN/$Z3_BIN$EXT)
ninja -j4
cp z3$EXT $BIN/$Z3_BIN$EXT
popd
(cd $BIN && ./$Z3_BIN$EXT --version && deps $Z3_BIN$EXT && ./$Z3_BIN$EXT $PROBLEM)
cleanup_bins
Expand Down

0 comments on commit 9204537

Please sign in to comment.