This PR should finally resolve the current issues with libpoly and windows cross compilation.
set(ANTLR3_JAR "${DEPS_BASE}/share/java/antlr-3.4-complete.jar")
set(ANTLR3_INCLUDE_DIR "${DEPS_BASE}/include/")
- set(ANTLR3_LIBRARIES "${DEPS_BASE}/${CMAKE_INSTALL_LIBDIR}/libantlr3c${CMAKE_SHARED_LIBRARY_SUFFIX}")
- set(ANTLR3_STATIC_LIBRARIES "${DEPS_BASE}/${CMAKE_INSTALL_LIBDIR}/libantlr3c.a")
+ set(ANTLR3_LIBRARIES "${DEPS_BASE}/${CMAKE_INSTALL_LIBDIR}/libantlr3c.a")
endif()
find_package(Java COMPONENTS Runtime REQUIRED)
set(ANTLR3_COMMAND ${Java_JAVA_EXECUTABLE} -cp "${ANTLR3_JAR}" org.antlr.Tool
CACHE STRING "run ANTLR3" FORCE)
-add_library(ANTLR3_SHARED SHARED IMPORTED GLOBAL)
-set_target_properties(ANTLR3_SHARED PROPERTIES
+add_library(ANTLR3 STATIC IMPORTED GLOBAL)
+set_target_properties(ANTLR3 PROPERTIES
IMPORTED_LOCATION "${ANTLR3_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${ANTLR3_INCLUDE_DIR}"
)
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
- set_target_properties(ANTLR3_SHARED PROPERTIES IMPORTED_IMPLIB "${ANTLR3_LIBRARIES}")
-endif()
-
-if(ENABLE_STATIC_LIBRARY)
- add_library(ANTLR3_STATIC STATIC IMPORTED GLOBAL)
- set_target_properties(ANTLR3_STATIC PROPERTIES
- IMPORTED_LOCATION "${ANTLR3_STATIC_LIBRARIES}"
- INTERFACE_INCLUDE_DIRECTORIES "${ANTLR3_INCLUDE_DIR}"
- )
+ set_target_properties(ANTLR3 PROPERTIES IMPORTED_IMPLIB "${ANTLR3_LIBRARIES}")
endif()
mark_as_advanced(ANTLR3_BINARY)
mark_as_advanced(ANTLR3_INCLUDE_DIR)
mark_as_advanced(ANTLR3_JAR)
mark_as_advanced(ANTLR3_LIBRARIES)
-mark_as_advanced(ANTLR3_STATIC_LIBRARIES)
if(ANTLR3_FOUND_SYSTEM)
message(STATUS "Found ANTLR3 runtime: ${ANTLR3_LIBRARIES}")
else()
message(STATUS "Building ANTLR3 runtime: ${ANTLR3_LIBRARIES}")
message(STATUS "Downloading ANTLR3 JAR: ${ANTLR3_JAR}")
- add_dependencies(ANTLR3_SHARED ANTLR3-EP-runtime ANTLR3-EP-jar)
- if(ENABLE_STATIC_LIBRARY)
- add_dependencies(ANTLR3_STATIC ANTLR3-EP-runtime ANTLR3-EP-jar)
- endif()
+ add_dependencies(ANTLR3 ANTLR3-EP-runtime ANTLR3-EP-jar)
endif()
<SOURCE_DIR>/configure --enable-shared --disable-static
--prefix=<INSTALL_DIR>/gmp-shared
--enable-cxx --with-pic --host=${TOOLCHAIN_PREFIX}
- BUILD_BYPRODUCTS <INSTALL_DIR>/lib/libgmp${CMAKE_SHARED_LIBRARY_SUFFIX}
+ BUILD_BYPRODUCTS <INSTALL_DIR>/gmp-shared/lib/libgmp.dll.a
)
ExternalProject_Add(
GMP-EP-static
<SOURCE_DIR>/configure --disable-shared --enable-static
--prefix=<INSTALL_DIR>/gmp-static
--enable-cxx --with-pic --host=${TOOLCHAIN_PREFIX}
- BUILD_BYPRODUCTS <INSTALL_DIR>/lib/libgmp.a
+ BUILD_BYPRODUCTS <INSTALL_DIR>/gmp-static/lib/libgmp.a
)
add_custom_target(GMP-EP DEPENDS GMP-EP-shared GMP-EP-static)
set(GMP_INCLUDE_DIR "${DEPS_BASE}/gmp-shared/include/")
set(GMP_STATIC_INCLUDE_DIR "${DEPS_BASE}/gmp-static/include/")
- set(GMP_LIBRARIES "${DEPS_BASE}/gmp-shared/bin/libgmp-10${CMAKE_SHARED_LIBRARY_SUFFIX}")
+ set(GMP_LIBRARIES "${DEPS_BASE}/gmp-shared/lib/libgmp.dll.a")
set(GMP_STATIC_LIBRARIES "${DEPS_BASE}/gmp-static/lib/libgmp.a")
file(MAKE_DIRECTORY "${GMP_INCLUDE_DIR}")
sed -i.orig "s/#include <stdio.h>/#include <stdio.h>\\\\n#include <inttypes.h>/" {} +
COMMAND find <SOURCE_DIR>/ -type f ! -name "*.orig" -exec
sed -i.orig "s/#include <cstdio>/#include <cstdio>\\\\n#include <inttypes.h>/" {} +
- # Help with finding GMP
- COMMAND sed -i.orig "s/find_library(GMP_LIBRARY gmp)/find_library(GMP_LIBRARY gmp gmp-10)/"
- <SOURCE_DIR>/CMakeLists.txt
)
else()
unset(patchcmd)
set_target_properties(cvc5parser-objs PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_compile_definitions(cvc5parser-objs PUBLIC -D__BUILDING_CVC5PARSERLIB -Dcvc5_obj_EXPORTS)
-add_dependencies(cvc5parser-objs ANTLR3_SHARED)
+add_dependencies(cvc5parser-objs ANTLR3)
target_include_directories(cvc5parser-objs PRIVATE ${ANTLR3_INCLUDE_DIR})
add_library(cvc5parser-shared SHARED $<TARGET_OBJECTS:cvc5parser-objs>)
set_target_properties(cvc5parser-shared PROPERTIES SOVERSION ${CVC5_SOVERSION})
set_target_properties(cvc5parser-shared PROPERTIES OUTPUT_NAME cvc5parser)
target_link_libraries(cvc5parser-shared PRIVATE cvc5-shared)
-if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
- target_link_libraries(cvc5parser-shared PRIVATE ANTLR3_STATIC)
-else()
- target_link_libraries(cvc5parser-shared PRIVATE ANTLR3_SHARED)
-endif()
+target_link_libraries(cvc5parser-shared PRIVATE ANTLR3)
install(TARGETS cvc5parser-shared
EXPORT cvc5-targets
add_library(cvc5parser-static STATIC $<TARGET_OBJECTS:cvc5parser-objs>)
set_target_properties(cvc5parser-static PROPERTIES OUTPUT_NAME cvc5parser)
target_link_libraries(cvc5parser-static PRIVATE cvc5-static)
- target_link_libraries(cvc5parser-static PRIVATE ANTLR3_STATIC)
+ target_link_libraries(cvc5parser-static PRIVATE ANTLR3)
install(TARGETS cvc5parser-objs cvc5parser-static
EXPORT cvc5-targets