Fix shared library Windows builds with LibPoly (#8306)
authorAndres Noetzli <andres.noetzli@gmail.com>
Wed, 16 Mar 2022 01:44:42 +0000 (18:44 -0700)
committerGitHub <noreply@github.com>
Wed, 16 Mar 2022 01:44:42 +0000 (01:44 +0000)
commitb90a6d149ecf65013f9e1c54a053a666aa651dd8
treed626b97ae71f0f044d97f5d78013a62ec4d6e97a
parent4a8d2407468eee50c91fc6cbe19f5edd8feeb688
Fix shared library Windows builds with LibPoly (#8306)

This commit fixes two issues that prevented us from compiling a shared
build of cvc5 for Windows:

    The search path of LibPoly is fixed to /usr/x86_64-w64-mingw32 when
    cross-compiling for Windows
    (https://github.com/SRI-CSL/libpoly/blob/06d4e3c1a1c18a5253398889c296ef787a3ce1cd/cmake/x86_64-w64-mingw32.cmake#L10).
    As a result, LibPoly was not able to find the cross-compiled version
    of GMP in our deps folder. Instead of passing search paths to
    LibPoly, this commit changes the CMAKE_ARGS passed to LibPoly to
    directly contain GMP_INCLUDE_DIR and GMP_LIBRARY.
    LibPoly installs the generated .dll files into bin instead of
    lib
    (https://github.com/SRI-CSL/libpoly/blob/06d4e3c1a1c18a5253398889c296ef787a3ce1cd/src/CMakeLists.txt#L91).
    The commit changes the by-products and
    Poly_LIBRARIES/PolyXX_LIBRARIES to account for this.
cmake/FindPoly.cmake