diff options
author | Gereon Kremer <gereon.kremer@cs.rwth-aachen.de> | 2021-03-27 10:41:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-27 09:41:49 +0000 |
commit | 4b7e392eca42f89d103c5eb74157a44d4b40fe4b (patch) | |
tree | 649e24b292ac6b6dba11fe4a0e5df69ab4406019 /src/parser | |
parent | 1ac0ebabb80f68c6c666d1eae1588c0950a6f2f7 (diff) |
Refactor ANTLR3 dependency (#6202)
This PR refactors our first, and arguably most fragile, dependency.
Right now all dependencies need to be manually installed (by calling the appropriate contrib/get-X script). For optional dependencies, we additionally need to enable them when calling the configure script (or via ccmake).
This PR is the first step in refactoring all dependencies to be automatically build (if required) as an external project.
Note that this not only eliminates the need to call contrib scripts, but also simplifies cross compilation: as all dependencies are now built within the build folders, every build folder has its own copy which may use different toolchains.
Diffstat (limited to 'src/parser')
-rw-r--r-- | src/parser/CMakeLists.txt | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/parser/CMakeLists.txt b/src/parser/CMakeLists.txt index 3ca7b8f40..fdf268dc6 100644 --- a/src/parser/CMakeLists.txt +++ b/src/parser/CMakeLists.txt @@ -8,11 +8,8 @@ ## All rights reserved. See the file COPYING in the top-level source ## directory for licensing information. ## -find_package(ANTLR REQUIRED) -if(NOT HAVE_ANTLR3_FILE_STREAM_NEW) - add_definitions(-DCVC4_ANTLR3_OLD_INPUT_STREAM) -endif() +find_package(ANTLR3 3.4 REQUIRED) # Java runtime is required for ANTLR find_package(Java COMPONENTS Runtime REQUIRED) @@ -76,7 +73,7 @@ foreach(lang Cvc Smt2 Tptp) ${CMAKE_CURRENT_BINARY_DIR}/${lang_dir}/${lang}Parser.h ${CMAKE_CURRENT_BINARY_DIR}/${lang_dir}/${lang}.tokens COMMAND - ${ANTLR_BINARY} + ${ANTLR3_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR}/${lang_dir}/${lang}.g -fo ${CMAKE_CURRENT_BINARY_DIR}/${lang_dir} DEPENDS @@ -104,8 +101,8 @@ endforeach() add_library(cvc4parser ${libcvc4parser_src_files}) set_target_properties(cvc4parser PROPERTIES SOVERSION ${CVC4_SOVERSION}) target_compile_definitions(cvc4parser PRIVATE -D__BUILDING_CVC4PARSERLIB) -target_link_libraries(cvc4parser cvc4 ${ANTLR_LIBRARIES}) -target_include_directories(cvc4parser PRIVATE ${ANTLR_INCLUDE_DIR}) +target_link_libraries(cvc4parser PUBLIC cvc4) +target_link_libraries(cvc4parser PRIVATE ANTLR3) install(TARGETS cvc4parser EXPORT cvc4-targets DESTINATION ${CMAKE_INSTALL_LIBDIR}) |