Skip to content

Commit dfedfcb

Browse files
committed
fix(note): embed reply runtime without exporting reply target
1 parent 676c38e commit dfedfcb

2 files changed

Lines changed: 21 additions & 36 deletions

File tree

CMakeLists.txt

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -157,46 +157,40 @@ function(vix_note_append_if_exists out_var path_value)
157157
endfunction()
158158

159159
# ============================================================================
160-
# Reply module
161-
# - ReplyCellRunner depends on vix::reply.
162-
# - Same style as CLI:
163-
# 1) use target already created by umbrella
164-
# 2) use local sibling module ../reply
165-
# 3) fallback to installed package
160+
# Reply runtime implementation
161+
# - Reply is used internally by Note's ReplyCellRunner.
162+
# - It is not part of the Vix umbrella export.
163+
# - Therefore we embed Reply sources into vix_note instead of exporting a
164+
# vix::reply dependency through VixTargets.
166165
# ============================================================================
167166

168167
get_filename_component(_VIX_NOTE_MODULES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/.." ABSOLUTE)
169168

170169
set(_VIX_REPLY_DIR "${_VIX_NOTE_MODULES_DIR}/reply")
171170

172-
if(NOT TARGET vix::reply AND NOT TARGET vix::vix_reply)
173-
if(EXISTS "${_VIX_REPLY_DIR}/CMakeLists.txt")
174-
message(STATUS "[note] Building inside Vix repo -> resolving local reply module")
171+
if(EXISTS "${_VIX_REPLY_DIR}/CMakeLists.txt")
172+
message(STATUS "[note] Embedding local reply runtime from ${_VIX_REPLY_DIR}")
175173

176-
set(VIX_REPLY_BUILD_TESTS OFF CACHE BOOL "Build Vix Reply tests" FORCE)
177-
set(VIX_REPLY_BUILD_EXAMPLES OFF CACHE BOOL "Build Vix Reply examples" FORCE)
174+
file(GLOB_RECURSE VIX_NOTE_REPLY_SOURCES
175+
CONFIGURE_DEPENDS
176+
"${_VIX_REPLY_DIR}/src/*.cpp"
177+
)
178178

179-
add_subdirectory("${_VIX_REPLY_DIR}" "${CMAKE_BINARY_DIR}/_vix_reply")
180-
else()
181-
message(STATUS "[note] Local reply module not found -> trying installed package")
179+
target_sources(vix_note PRIVATE ${VIX_NOTE_REPLY_SOURCES})
182180

183-
find_package(vix_reply CONFIG QUIET)
184-
endif()
185-
endif()
181+
target_include_directories(vix_note
182+
PRIVATE
183+
"${_VIX_REPLY_DIR}/include"
184+
)
186185

187-
if(TARGET vix::reply)
188-
message(STATUS "[note] Reply runtime enabled")
189-
target_link_libraries(vix_note PUBLIC vix::reply)
190-
elseif(TARGET vix::vix_reply)
191-
message(STATUS "[note] Reply runtime enabled")
192-
target_link_libraries(vix_note PUBLIC vix::vix_reply)
186+
target_compile_definitions(vix_note
187+
PRIVATE
188+
VIX_NOTE_HAS_REPLY=1
189+
)
193190
else()
194191
message(FATAL_ERROR
195192
"Missing dependency for vix_note.\n"
196-
"Expected one of:\n"
197-
" - umbrella target vix::reply\n"
198-
" - local sibling module in ../reply\n"
199-
" - installed package providing vix::reply or vix::vix_reply"
193+
"Expected local sibling module in ../reply because Note uses ReplyCellRunner."
200194
)
201195
endif()
202196

cmake/vix_noteConfig.cmake.in

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
@PACKAGE_INIT@
22

3-
include(CMakeFindDependencyMacro)
4-
5-
find_dependency(vix_reply CONFIG)
6-
7-
if(NOT TARGET vix::reply AND TARGET vix::vix_reply)
8-
add_library(vix::reply INTERFACE IMPORTED)
9-
target_link_libraries(vix::reply INTERFACE vix::vix_reply)
10-
endif()
11-
123
include("${CMAKE_CURRENT_LIST_DIR}/vix_noteTargets.cmake")
134

145
check_required_components(vix_note)

0 commit comments

Comments
 (0)