mirror of
https://github.com/Z3Prover/z3
synced 2026-09-05 20:24:24 +00:00
In #10717 we enhanced the CMake package to support multiple build configurations, so that Z3 could be installed and consumed as either a static or shared package, or both side by side. This PR dog-foods that work: the Python bindings and the example projects now consume Z3 through the same installed CMake package that external users rely on, rather than through separate in-tree plumbing. To make that possible, we introduce a `z3::libz3` ALIAS that mirrors the installed target in-tree. In-tree consumers (like the examples and the Python bindings) and out-of-tree consumers of the installed package now refer to Z3 the same way, so now there's one blessed interface. The examples and package-consumer test were updated accordingly, both to exercise this path and to serve as a model for how downstream projects should consume Z3 going forward. Finally, we add test coverage for the reworked Python build, including a CI job that installs a shared build of libz3 and then builds the Python bindings against that installed package, confirming the Python-only build path works end to end. |
||
|---|---|---|
| .. | ||
| CMakeLists.txt | ||
| example.cpp | ||
| README | ||
Small example using the c++ bindings. To build the example execute make examples in the build directory. This command will create the executable cpp_example. On Windows, you can just execute it. On macOS and Linux, you must install z3 first using sudo make install OR update LD_LIBRARY_PATH (Linux) or DYLD_LIBRARY_PATH (macOS) with the build directory. You need that to be able to find the Z3 shared library.