Skip to content

Commit ad40d6e

Browse files
committed
fix(ml): make MNE_USE_ONNXRUNTIME PUBLIC to fix ABI mismatch
The compile definition was PRIVATE, so only libmne_ml saw it. Consumers (e.g. test_ml_models) compiled ml_onnx_model.h without the define and got a smaller class layout (missing ORT member variables), causing stack corruption ('stack smashing detected').
1 parent 8ddc647 commit ad40d6e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/libraries/ml/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ target_link_libraries(${PROJECT_NAME} PRIVATE
5353
# ONNX Runtime (optional — enabled when USE_ONNXRUNTIME=ON and the package was found)
5454
if(TARGET onnxruntime::onnxruntime)
5555
target_link_libraries(${PROJECT_NAME} PRIVATE onnxruntime::onnxruntime)
56-
target_compile_definitions(${PROJECT_NAME} PRIVATE MNE_USE_ONNXRUNTIME)
56+
target_compile_definitions(${PROJECT_NAME} PUBLIC MNE_USE_ONNXRUNTIME)
5757
message(STATUS "[mne_ml] ONNX Runtime enabled")
5858

5959
# Copy the ONNX Runtime shared library next to mne_ml so the runtime linker

0 commit comments

Comments
 (0)