aboutsummaryrefslogtreecommitdiff
path: root/src/univalue/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/univalue/CMakeLists.txt')
-rw-r--r--src/univalue/CMakeLists.txt41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/univalue/CMakeLists.txt b/src/univalue/CMakeLists.txt
new file mode 100644
index 0000000000..96733fe077
--- /dev/null
+++ b/src/univalue/CMakeLists.txt
@@ -0,0 +1,41 @@
+# Copyright (c) 2023-present The Bitcoin Core developers
+# Distributed under the MIT software license, see the accompanying
+# file COPYING or https://opensource.org/license/mit/.
+
+add_library(univalue STATIC EXCLUDE_FROM_ALL
+ lib/univalue.cpp
+ lib/univalue_get.cpp
+ lib/univalue_read.cpp
+ lib/univalue_write.cpp
+)
+target_include_directories(univalue
+ PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+)
+target_link_libraries(univalue PRIVATE core_interface)
+
+if(BUILD_TESTS)
+ add_executable(unitester test/unitester.cpp)
+ target_compile_definitions(unitester
+ PRIVATE
+ JSON_TEST_SRC=\"${CMAKE_CURRENT_SOURCE_DIR}/test\"
+ )
+ target_link_libraries(unitester
+ PRIVATE
+ core_interface
+ univalue
+ )
+ add_test(NAME univalue_test
+ COMMAND unitester
+ )
+
+ add_executable(object test/object.cpp)
+ target_link_libraries(object
+ PRIVATE
+ core_interface
+ univalue
+ )
+ add_test(NAME univalue_object_test
+ COMMAND object
+ )
+endif()