From 29d19c62ff1a65665f852134c24c17cca45251cd Mon Sep 17 00:00:00 2001 From: Gereon Kremer Date: Tue, 20 Apr 2021 18:22:47 +0200 Subject: [PATCH] Properly link Poly against GMP (#6398) This PR fixes a linker issue with libpoly and static builds where Poly and GMP would be linked against in the wrong order. --- cmake/FindPoly.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/FindPoly.cmake b/cmake/FindPoly.cmake index 1259459a2..4521605b9 100644 --- a/cmake/FindPoly.cmake +++ b/cmake/FindPoly.cmake @@ -93,7 +93,6 @@ if(NOT Poly_FOUND_SYSTEM) DEPENDEES install COMMAND ${CMAKE_COMMAND} -E remove_directory /test/ ) - add_dependencies(Poly-EP GMP) set(Poly_INCLUDE_DIR "${DEPS_BASE}/include/") set(Poly_LIBRARIES "${DEPS_BASE}/lib/libpicpoly.a") @@ -107,6 +106,7 @@ set_target_properties(Poly PROPERTIES IMPORTED_LOCATION "${Poly_LIBRARIES}") set_target_properties( Poly PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${Poly_INCLUDE_DIR}" ) +target_link_libraries(Poly INTERFACE GMP) add_library(Polyxx STATIC IMPORTED GLOBAL) set_target_properties(Polyxx PROPERTIES IMPORTED_LOCATION "${PolyXX_LIBRARIES}") -- 2.30.2