Skip to content

Commit

Permalink
univalue: add initial cmake support
Browse files Browse the repository at this point in the history
  • Loading branch information
aleflm committed Dec 15, 2024
1 parent b49a430 commit 36ef8ae
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions src/univalue/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit 36ef8ae

Please sign in to comment.