Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ if (NOT TARGET xeus AND NOT TARGET xeus-static)
endif ()

find_package(CppInterOp ${CppInterOp_REQUIRED_VERSION} REQUIRED)

# Extract filename without extension
get_filename_component(_name "${CPPINTEROP_LIBRARIES}" NAME_WE)

# Remove "lib" prefix
string(REGEX REPLACE "^lib" "" CPPINTEROP_TARGET "${_name}")

if(CppInterOp_FOUND)
message(STATUS "Found CppInterOp: config=${CPPINTEROP_CMAKE_DIR} dir=${CPPINTEROP_INSTALL_PREFIX} (found version=${CPPINTEROP_VERSION} compatible with Clang ${CPPINTEROP_LLVM_VERSION_MAJOR}.x)")
endif()
Expand Down Expand Up @@ -339,7 +346,7 @@ macro(xeus_cpp_create_target target_name linkage output_name)
endif()

# Existing target_link_libraries call, adjusted for clarity
target_link_libraries(${target_name} PUBLIC ${XEUS_CPP_XEUS_TARGET} clangCppInterOp pugixml argparse::argparse)
target_link_libraries(${target_name} PUBLIC ${XEUS_CPP_XEUS_TARGET} ${CPPINTEROP_TARGET} pugixml argparse::argparse)

# Ensure all linked libraries use the same runtime library
if (MSVC)
Expand All @@ -360,9 +367,9 @@ macro(xeus_cpp_create_target target_name linkage output_name)
endif()

# Curl initialised specifically for xassist
target_link_libraries(${target_name} PUBLIC ${XEUS_CPP_XEUS_TARGET} clangCppInterOp pugixml argparse::argparse CURL::libcurl)
target_link_libraries(${target_name} PUBLIC ${XEUS_CPP_XEUS_TARGET} ${CPPINTEROP_TARGET} pugixml argparse::argparse CURL::libcurl)
else ()
target_link_libraries(${target_name} PUBLIC ${XEUS_CPP_XEUS_TARGET} clangCppInterOp pugixml argparse::argparse)
target_link_libraries(${target_name} PUBLIC ${XEUS_CPP_XEUS_TARGET} ${CPPINTEROP_TARGET} pugixml argparse::argparse)
endif()

if (WIN32 OR CYGWIN)
Expand Down
2 changes: 1 addition & 1 deletion share/jupyter/kernels/xc11/wasm_kernel.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"debugger": false,
"shared": {
"libxeus.so": "lib/libxeus.so",
"libclangCppInterOp.so": "lib/libclangCppInterOp.so"
"lib@CPPINTEROP_TARGET@.so": "lib/lib@CPPINTEROP_TARGET@.so"
}
}
}
2 changes: 1 addition & 1 deletion share/jupyter/kernels/xc17/wasm_kernel.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"debugger": false,
"shared": {
"libxeus.so": "lib/libxeus.so",
"libclangCppInterOp.so": "lib/libclangCppInterOp.so"
"lib@CPPINTEROP_TARGET@.so": "lib/lib@CPPINTEROP_TARGET@.so"
}
}
}
2 changes: 1 addition & 1 deletion share/jupyter/kernels/xc23/wasm_kernel.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"debugger": false,
"shared": {
"libxeus.so": "lib/libxeus.so",
"libclangCppInterOp.so": "lib/libclangCppInterOp.so"
"lib@CPPINTEROP_TARGET@.so": "lib/lib@CPPINTEROP_TARGET@.so"
}
}
}
2 changes: 1 addition & 1 deletion share/jupyter/kernels/xcpp17/wasm_kernel.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"debugger": false,
"shared": {
"libxeus.so": "lib/libxeus.so",
"libclangCppInterOp.so": "lib/libclangCppInterOp.so"
"lib@CPPINTEROP_TARGET@.so": "lib/lib@CPPINTEROP_TARGET@.so"
}
}
}
2 changes: 1 addition & 1 deletion share/jupyter/kernels/xcpp20/wasm_kernel.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"debugger": false,
"shared": {
"libxeus.so": "lib/libxeus.so",
"libclangCppInterOp.so": "lib/libclangCppInterOp.so"
"lib@CPPINTEROP_TARGET@.so": "lib/lib@CPPINTEROP_TARGET@.so"
}
}
}
2 changes: 1 addition & 1 deletion share/jupyter/kernels/xcpp23/wasm_kernel.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"debugger": false,
"shared": {
"libxeus.so": "lib/libxeus.so",
"libclangCppInterOp.so": "lib/libclangCppInterOp.so"
"lib@CPPINTEROP_TARGET@.so": "lib/lib@CPPINTEROP_TARGET@.so"
}
}
}
6 changes: 3 additions & 3 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ if(EMSCRIPTEN)

add_custom_command(TARGET test_xeus_cpp POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_INSTALL_PREFIX}/lib/libclangCppInterOp.so
${CMAKE_CURRENT_BINARY_DIR}/libclangCppInterOp.so
COMMENT "Copying libclangCppInterOp.so to the test directory"
${CMAKE_INSTALL_PREFIX}/lib/lib${CPPINTEROP_TARGET}.so
${CMAKE_CURRENT_BINARY_DIR}/lib${CPPINTEROP_TARGET}.so
COMMENT "Copying lib${CPPINTEROP_TARGET}.so to the test directory"
)

add_custom_command(TARGET test_xeus_cpp POST_BUILD
Expand Down
Loading