|
7 | 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
8 | 8 | # |
9 | 9 | # Unless required by applicable law or agreed to in writing, software |
10 | | -# distributed under the License is distributed on an "AS IS" BASIS, |
11 | | -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | | -# See the License for the specific language governing permissions and |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and |
13 | 11 | # limitations under the License. |
14 | 12 |
|
15 | 13 | import time |
@@ -626,3 +624,47 @@ def common_installer_llvm(properties): |
626 | 624 | return False |
627 | 625 |
|
628 | 626 | return True |
| 627 | + |
| 628 | +def common_installer_z3(properties): |
| 629 | + repository_path = properties["repository_path"] |
| 630 | + verbose_output = properties["verbose"] |
| 631 | + debug = properties["debug"] |
| 632 | + |
| 633 | + source_folder = download_github_source_archive(properties, "Z3Prover", "z3", branch="z3-4.8.8") |
| 634 | + if source_folder is None: |
| 635 | + return False |
| 636 | + |
| 637 | + build_folder = os.path.join("build", "z3") |
| 638 | + if not os.path.isdir(build_folder): |
| 639 | + try: |
| 640 | + os.mkdir(build_folder) |
| 641 | + |
| 642 | + except: |
| 643 | + print(" x Failed to create the build folder") |
| 644 | + return False |
| 645 | + |
| 646 | + cmake_command = ["cmake"] + get_env_compiler_settings() + get_cmake_build_type(debug) + get_cmake_generator() |
| 647 | + cmake_command += ["-DCMAKE_CXX_STANDARD=11", |
| 648 | + "-DCMAKE_CXX_EXTENSIONS=ON", |
| 649 | + "-DZ3_BUILD_LIBZ3_SHARED=False", |
| 650 | + "-DZ3_ENABLE_EXAMPLE_TARGETS=False", |
| 651 | + "-DZ3_BUILD_DOCUMENTATION=False", |
| 652 | + "-DZ3_BUILD_EXECUTABLE=True", |
| 653 | + "-DZ3_BUILD_TEST_EXECUTABLES=False", |
| 654 | + "-DZ3_USE_LIB_GMP=False", |
| 655 | + "-DZ3_ENABLE_TRACING_FOR_NON_DEBUG=False", |
| 656 | + "-DCMAKE_INSTALL_PREFIX=" + os.path.join(repository_path, "z3"), |
| 657 | + source_folder] |
| 658 | + |
| 659 | + if not run_program("Configuring...", cmake_command, build_folder, verbose=verbose_output): |
| 660 | + return False |
| 661 | + |
| 662 | + cmake_command = ["cmake", "--build", "."] + get_cmake_build_configuration(debug) + [ "--", get_parallel_build_options()] |
| 663 | + if not run_program("Building...", cmake_command, build_folder, verbose=verbose_output): |
| 664 | + return False |
| 665 | + |
| 666 | + cmake_command = ["cmake", "--build", "."] + get_cmake_build_configuration(debug) + ["--target", "install"] |
| 667 | + if not run_program("Installing...", cmake_command, build_folder, verbose=verbose_output): |
| 668 | + return False |
| 669 | + |
| 670 | + return True |
0 commit comments