diff --git a/msat/CMakeLists.txt b/msat/CMakeLists.txt index 1bda8ca55..f35115dec 100644 --- a/msat/CMakeLists.txt +++ b/msat/CMakeLists.txt @@ -21,22 +21,18 @@ target_link_libraries(smt-switch-msat ${GMPXX_LIBRARIES}) if (SMT_SWITCH_LIB_TYPE STREQUAL STATIC) # we want the static library to include the mathsat source # we need to unpack and repack the libraries - # newer versions of mathsat (5.6.4+) have the same issue as cvc5 where - # unpacking and repacking with ar seemed to lose info (missing symbols) - # the work around is to just copy libmathsat.a and add to it add_custom_command( OUTPUT static-smt-switch-msat.stamp COMMAND - mkdir ssm && cd ssm && - ar -x "../$" && cd ../ - && rm "$" && - # copy the mathsat static library to libsmt-switch-msat.a - cp "${MSAT_HOME}/lib/libmathsat.a" "$" && - # add the smt-switch-msat object files to the static library - bash -c "ar -rs $ ./ssm/*.o" - && - # now clean up the temporary directory - rm -rf ssm + mkdir smt-switch-msat-working && cd smt-switch-msat-working && + # create new static library that combines them all + ${PROJECT_SOURCE_DIR}/scripts/repack-static-lib.sh "$" + "${MSAT_HOME}/lib/libmathsat.a" + "../$" && + # replace the original one + mv "$" "../$" && + # now clean up the temporary directory + cd .. && rm -rf smt-switch-msat-working COMMAND ${CMAKE_COMMAND} -E touch static-smt-switch-msat.stamp DEPENDS smt-switch-msat