Skip to content

Commit 566363d

Browse files
Bitwuzla: Add an option -Dbitwuzla.rebuildWrapper=on to the build script. If this option is not specified, or set to false the SWIG wrapper will not be recreated.
1 parent 3ae7860 commit 566363d

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

build.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ SPDX-License-Identifier: Apache-2.0
8383
<delete includeEmptyDirs="true">
8484
<fileset dir="." includes="${class.dir}/** ${ivy.module}-*.jar ivy-*.xml *.so *.dll *.dylib *.jar"/>
8585
<fileset dir="lib/native/source/libmathsat5j" includes="*.so *.dll *.o"/>
86-
<fileset dir="${bitwuzla.path}" includes="include/ src/"/>
87-
<fileset dir="${bitwuzla.path}" includes="bitwuzla_wrap.cpp bitwuzla_wrap.h bitwuzla_wrap.o"/>
86+
<fileset dir="${bitwuzla.path}" includes="include/"/>
87+
<fileset dir="${bitwuzla.path}" includes="bitwuzla_wrap.o"/>
8888
</delete>
8989
</target>
9090

build/build-publish-solvers/solver-bitwuzla.xml

+20-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ SPDX-License-Identifier: Apache-2.0
1515

1616
<import file="macros.xml"/>
1717

18-
<target name="package-bitwuzla" depends="">
18+
<!-- Determine version and build the Bitwuzla binaries -->
19+
<target name="build-bitwuzla">
1920
<fail unless="bitwuzla.path">
2021
Please specify the path to Bitwuzla with the flag -Dbitwuzla.path=/path/to/bitwuzla.
2122
The path has to point to the root Bitwuzla folder, i.e.,
@@ -60,6 +61,14 @@ SPDX-License-Identifier: Apache-2.0
6061
<arg value="install"/>
6162
</exec>
6263

64+
<!-- check if -Dbitwuzla.rebuildWrapper=on was used-->
65+
<condition property="rebuild">
66+
<istrue value="${bitwuzla.rebuildWrapper}"/>
67+
</condition>
68+
</target>
69+
70+
<!-- Run swig to generate a new wrapper. Only executed if rebuildWrapper was specified. -->
71+
<target name="build-wrapper" if="rebuild" depends="build-bitwuzla">
6372
<!-- copy bitwuzla include files to the source tree -->
6473
<delete dir="${source.path}/include" quiet="true"/>
6574
<copy todir="${source.path}">
@@ -90,7 +99,17 @@ SPDX-License-Identifier: Apache-2.0
9099
<arg value="-i"/>
91100
<arg value="lib/native/source/libbitwuzla/phantomReferences.patch"/>
92101
</exec>
102+
</target>
93103

104+
<!-- Skip rebuilding the swig header if rebuildWrapper was not specified -->
105+
<target name="skip-wrapper" unless="rebuild" depends="build-bitwuzla">
106+
<echo>WARNING: Skipping the build step for the SWIG wrapper.
107+
If the Bitwuzla API has changed since the last release the wrapper should be updated. Use
108+
option -Dbitwuzla.rebuildWrapper to run SWIG and automatically generate a new wrapper.</echo>
109+
</target>
110+
111+
<!-- Continue with the build and package everything -->
112+
<target name="package-bitwuzla" depends="build-wrapper, skip-wrapper">
94113
<!-- compile java proxies and create jar file -->
95114
<mkdir dir="${source.path}/build"/>
96115
<javac release="11" srcdir="${source.path}/src/" destdir="${source.path}/build" includeantruntime="false"
@@ -214,7 +233,6 @@ SPDX-License-Identifier: Apache-2.0
214233
</exec>
215234
</target>
216235

217-
218236
<target name="publish-bitwuzla" depends="package-bitwuzla, load-ivy"
219237
description="Publish Bitwuzla binaries to Ivy repository.">
220238
<ivy:resolve conf="solver-bitwuzla" file="solvers_ivy_conf/ivy_bitwuzla.xml"/>

0 commit comments

Comments
 (0)