From 36ef8ae143d0ce1ac1c9e22d6fa43d32f3e63f63 Mon Sep 17 00:00:00 2001 From: AlefLm Date: Sun, 15 Dec 2024 01:57:04 +0000 Subject: [PATCH] univalue: add initial cmake support --- src/univalue/CMakeLists.txt | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/univalue/CMakeLists.txt 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 + $ +) +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()