summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Noetzli <andres.noetzli@gmail.com>2021-05-24 20:21:16 -0700
committerGitHub <noreply@github.com>2021-05-25 03:21:16 +0000
commit8e1eac35d265eacfbeb5f16be61e5d4caf45d1af (patch)
tree0cb4f15e26695cddc18a7de327d015e771fe1323
parent8b68ade92a8687c85a595b116da2da9ca03af5ed (diff)
[Unit tests] Fix path of Java bindings (#6616)
Currently, when configuring cvc5 with Java bindings, CMake complains about `get_filename_component(CVC5_JNI_PATH ${CVC5_JAR_PATH} DIRECTORY)` not using the correct number of arguments in the Java unit tests. The issue is that `${CVC5_JAR_PATH}` is empty. The value of `${CVC5_JAR_PATH}` was computed in the Java API bindings but then not shared with the rest of the build system. Because `${CVC5_JAR_PATH}` is not used anywhere else, this commit moves the computation of `${CVC5_JAR_PATH}` to the unit tests. The commit also ensures that the API subdirectories are processed before the test subdirectories.
-rw-r--r--CMakeLists.txt3
-rw-r--r--src/api/java/CMakeLists.txt2
-rw-r--r--test/unit/api/java/CMakeLists.txt2
3 files changed, 4 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1c6ad1604..d7512e874 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -503,7 +503,6 @@ endif()
# Add subdirectories
add_subdirectory(src)
-add_subdirectory(test)
if(BUILD_BINDINGS_PYTHON)
set(BUILD_BINDINGS_PYTHON_VERSION ${PYTHON_VERSION_MAJOR})
@@ -519,6 +518,8 @@ if(BUILD_DOCS)
add_subdirectory(docs)
endif()
+add_subdirectory(test)
+
#-----------------------------------------------------------------------------#
# Package configuration
#
diff --git a/src/api/java/CMakeLists.txt b/src/api/java/CMakeLists.txt
index d56f594ce..53ea46f46 100644
--- a/src/api/java/CMakeLists.txt
+++ b/src/api/java/CMakeLists.txt
@@ -112,5 +112,3 @@ add_jar(cvc5jar
)
add_dependencies(cvc5jar generate-java-kinds cvc5jni cvc5)
-
-get_target_property(CVC5_JAR_PATH cvc5jar JAR_FILE) \ No newline at end of file
diff --git a/test/unit/api/java/CMakeLists.txt b/test/unit/api/java/CMakeLists.txt
index 0ef649b87..fe497ef3b 100644
--- a/test/unit/api/java/CMakeLists.txt
+++ b/test/unit/api/java/CMakeLists.txt
@@ -17,6 +17,8 @@ find_package(Java REQUIRED)
include(UseJava)
find_package(JUnit REQUIRED)
+get_target_property(CVC5_JAR_PATH cvc5jar JAR_FILE)
+
# specify source files for junit tests
set(java_test_src_files
${CMAKE_CURRENT_SOURCE_DIR}/cvc5/SolverTest.java
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback