Fix pywallet3 build

- link against logging/fmt/spdlog targets
- make sure we have the proper defines carried over from the main build
This commit is contained in:
Jason Rhinelander 2023-04-13 16:28:10 -03:00
parent 0cef2a9491
commit 5436df9615
No known key found for this signature in database
GPG Key ID: C4992CE7A88D4262
2 changed files with 16 additions and 2 deletions

View File

@ -9,7 +9,13 @@ pybind11_add_module(pywallet3 MODULE
wallet/daemon_comms_config.cpp
wallet/rpc_config.cpp
)
target_link_libraries(pywallet3 PUBLIC wallet3)
target_link_libraries(pywallet3
PUBLIC
wallet3
logging
oxen::logging
spdlog::spdlog
fmt::fmt)
target_include_directories(pywallet3 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
file(GENERATE

View File

@ -9,8 +9,15 @@ pywallet3_sources = ['$<TARGET_PROPERTY:pywallet3,SOURCE_DIR>/' + src for src in
'$<JOIN:$<TARGET_PROPERTY:pywallet3,SOURCES>,',
'>')]
pywallet3_include_dirs = [
'$<JOIN:$<TARGET_PROPERTY:wallet3,INCLUDE_DIRECTORIES>,',
'$<JOIN:$<TARGET_PROPERTY:pywallet3,INCLUDE_DIRECTORIES>,',
'>']
pywallet3_defs = []
for d in [
'$<JOIN:$<TARGET_PROPERTY:pywallet3,COMPILE_DEFINITIONS>,',
'>']:
parts = d.split("=", 1)
pywallet3_defs.append((parts[0], parts[1] if len(parts) == 2 else None))
# Note:
# Sort input source files if you glob sources to ensure bit-for-bit
@ -21,6 +28,7 @@ ext_modules = [Pybind11Extension(
pywallet3_sources,
cxx_std=17,
include_dirs=pywallet3_include_dirs,
define_macros=pywallet3_defs,
extra_objects=['$<TARGET_PROPERTY:wallet3,BINARY_DIR>/libwallet3_merged.a'],
),
]