From: Andres Noetzli Date: Tue, 20 Apr 2021 18:46:14 +0000 (-0700) Subject: Fix `ANTLR3_COMMAND` for system ANTLR3 JAR (#6399) X-Git-Tag: cvc5-1.0.0~1883 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1d5a6e4a0773064ca0f1465b5e94a301af4eee2e;p=cvc5.git Fix `ANTLR3_COMMAND` for system ANTLR3 JAR (#6399) ANTLR3_COMMAND was using a fixed path instead of relying on the ANTLR3_JAR variable. If the ANTLR3 JAR was found on the system (for example due to an existing deps folder at the root of the CVC4 folder), then the command would fail because the JAR was not at the expected location. This commit changes the command to use the variable and prints the location of the JAR file to make debugging easier. --- diff --git a/cmake/FindANTLR3.cmake b/cmake/FindANTLR3.cmake index 8b05c1dc7..5429be99a 100644 --- a/cmake/FindANTLR3.cmake +++ b/cmake/FindANTLR3.cmake @@ -108,8 +108,7 @@ set(ANTLR3_FOUND TRUE) # This may not be a single binary: the EP has a whole commandline # We thus do not make this an executable target. # Just call ${ANTLR3_COMMAND} instead. -set(ANTLR3_COMMAND ${Java_JAVA_EXECUTABLE} -cp - "${DEPS_BASE}/share/java/antlr-3.4-complete.jar" org.antlr.Tool +set(ANTLR3_COMMAND ${Java_JAVA_EXECUTABLE} -cp "${ANTLR3_JAR}" org.antlr.Tool CACHE STRING "run ANTLR3" FORCE) add_library(ANTLR3 STATIC IMPORTED GLOBAL) @@ -126,7 +125,9 @@ mark_as_advanced(ANTLR3_RUNTIME) if(ANTLR3_FOUND_SYSTEM) message(STATUS "Found ANTLR3 runtime: ${ANTLR3_RUNTIME}") + message(STATUS "Found ANTLR3 JAR: ${ANTLR3_JAR}") else() message(STATUS "Building ANTLR3 runtime: ${ANTLR3_RUNTIME}") + message(STATUS "Downloading ANTLR3 JAR: ${ANTLR3_JAR}") add_dependencies(ANTLR3 ANTLR3-EP-runtime ANTLR3-EP-jar) endif()