From: Gereon Kremer Date: Fri, 5 Nov 2021 18:53:54 +0000 (-0700) Subject: Fix some issues with the java api (#7583) X-Git-Tag: cvc5-1.0.0~880 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=51c3b3d6bb992550476220dd44a57a3e7987dce0;p=cvc5.git Fix some issues with the java api (#7583) This PR fixes two issues with the java api: - the JNI_HEADERS variable was set to a non-existent file, which caused the generate-jni-headers target to always rebuilt. - the directory structure was unnecessarily nested (probably because we use CMAKE_CURRENT_BINARY_DIR instead of CMAKE_BINARY_DIR). --- diff --git a/src/api/java/CMakeLists.txt b/src/api/java/CMakeLists.txt index ad4183f25..754e20bf8 100644 --- a/src/api/java/CMakeLists.txt +++ b/src/api/java/CMakeLists.txt @@ -14,15 +14,15 @@ ## # create directories -file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/src/api/java/io/github/cvc5/api") -set(JNI_DIR "${CMAKE_CURRENT_BINARY_DIR}/src/api/java/jni") +file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/io/github/cvc5/api") +set(JNI_DIR "${CMAKE_CURRENT_BINARY_DIR}/jni") file(MAKE_DIRECTORY ${JNI_DIR}) # Generate Kind.java configure_file(genkinds.py.in genkinds.py) set(JAVA_KIND_FILE - "${CMAKE_CURRENT_BINARY_DIR}/src/api/java/io/github/cvc5/api/Kind.java" + "${CMAKE_CURRENT_BINARY_DIR}/io/github/cvc5/api/Kind.java" ) add_custom_command( @@ -34,7 +34,7 @@ add_custom_command( "${PYTHON_EXECUTABLE}" "${CMAKE_CURRENT_BINARY_DIR}/genkinds.py" --kinds-header "${PROJECT_SOURCE_DIR}/src/api/cpp/cvc5_kind.h" - --kinds-file-prefix "${CMAKE_CURRENT_BINARY_DIR}/src/api/java/io/github/cvc5/api/Kind" + --kinds-file-prefix "${CMAKE_CURRENT_BINARY_DIR}/io/github/cvc5/api/Kind" DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/genkinds.py" "${PROJECT_SOURCE_DIR}/src/api/cpp/cvc5_kind.h" @@ -76,15 +76,13 @@ set(JAVA_FILES # specify generated jni headers set(JNI_HEADERS - ${JNI_DIR}/cvc5_Solver.h + ${JNI_DIR}/io_github_cvc5_api_Solver.h ) # generate jni headers add_custom_command( OUTPUT ${JNI_HEADERS} - BYPRODUCTS - ${JNI_HEADERS} COMMAND # generate jni header files ${Java_JAVAC_EXECUTABLE} -h ${JNI_DIR} ${JAVA_FILES} -d ${JNI_DIR}