Skip to content

Commit 54c81a4

Browse files
committed
Account for change of name of CppInterOp target (clangCppInterOp to CppInterOp)
1 parent 88a82c5 commit 54c81a4

8 files changed

Lines changed: 19 additions & 12 deletions

File tree

CMakeLists.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ if (NOT TARGET xeus AND NOT TARGET xeus-static)
101101
endif ()
102102

103103
find_package(CppInterOp ${CppInterOp_REQUIRED_VERSION} REQUIRED)
104+
105+
# Extract filename without extension
106+
get_filename_component(_name "${CPPINTEROP_LIBRARIES}" NAME_WE)
107+
108+
# Remove "lib" prefix
109+
string(REGEX REPLACE "^lib" "" CPPINTEROP_TARGET "${_name}")
110+
104111
if(CppInterOp_FOUND)
105112
message(STATUS "Found CppInterOp: config=${CPPINTEROP_CMAKE_DIR} dir=${CPPINTEROP_INSTALL_PREFIX} (found version=${CPPINTEROP_VERSION} compatible with Clang ${CPPINTEROP_LLVM_VERSION_MAJOR}.x)")
106113
endif()
@@ -339,7 +346,7 @@ macro(xeus_cpp_create_target target_name linkage output_name)
339346
endif()
340347

341348
# Existing target_link_libraries call, adjusted for clarity
342-
target_link_libraries(${target_name} PUBLIC ${XEUS_CPP_XEUS_TARGET} clangCppInterOp pugixml argparse::argparse)
349+
target_link_libraries(${target_name} PUBLIC ${XEUS_CPP_XEUS_TARGET} ${CPPINTEROP_TARGET} pugixml argparse::argparse)
343350

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

362369
# Curl initialised specifically for xassist
363-
target_link_libraries(${target_name} PUBLIC ${XEUS_CPP_XEUS_TARGET} clangCppInterOp pugixml argparse::argparse CURL::libcurl)
370+
target_link_libraries(${target_name} PUBLIC ${XEUS_CPP_XEUS_TARGET} ${CPPINTEROP_TARGET} pugixml argparse::argparse CURL::libcurl)
364371
else ()
365-
target_link_libraries(${target_name} PUBLIC ${XEUS_CPP_XEUS_TARGET} clangCppInterOp pugixml argparse::argparse)
372+
target_link_libraries(${target_name} PUBLIC ${XEUS_CPP_XEUS_TARGET} ${CPPINTEROP_TARGET} pugixml argparse::argparse)
366373
endif()
367374

368375
if (WIN32 OR CYGWIN)

share/jupyter/kernels/xc11/wasm_kernel.json.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"debugger": false,
1515
"shared": {
1616
"libxeus.so": "lib/libxeus.so",
17-
"libclangCppInterOp.so": "lib/libclangCppInterOp.so"
17+
"lib@CPPINTEROP_TARGET@.so": "lib/lib@CPPINTEROP_TARGET@.so"
1818
}
1919
}
2020
}

share/jupyter/kernels/xc17/wasm_kernel.json.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"debugger": false,
1515
"shared": {
1616
"libxeus.so": "lib/libxeus.so",
17-
"libclangCppInterOp.so": "lib/libclangCppInterOp.so"
17+
"lib@CPPINTEROP_TARGET@.so": "lib/lib@CPPINTEROP_TARGET@.so"
1818
}
1919
}
2020
}

share/jupyter/kernels/xc23/wasm_kernel.json.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"debugger": false,
1515
"shared": {
1616
"libxeus.so": "lib/libxeus.so",
17-
"libclangCppInterOp.so": "lib/libclangCppInterOp.so"
17+
"lib@CPPINTEROP_TARGET@.so": "lib/lib@CPPINTEROP_TARGET@.so"
1818
}
1919
}
2020
}

share/jupyter/kernels/xcpp17/wasm_kernel.json.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"debugger": false,
1414
"shared": {
1515
"libxeus.so": "lib/libxeus.so",
16-
"libclangCppInterOp.so": "lib/libclangCppInterOp.so"
16+
"lib@CPPINTEROP_TARGET@.so": "lib/lib@CPPINTEROP_TARGET@.so"
1717
}
1818
}
1919
}

share/jupyter/kernels/xcpp20/wasm_kernel.json.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"debugger": false,
1414
"shared": {
1515
"libxeus.so": "lib/libxeus.so",
16-
"libclangCppInterOp.so": "lib/libclangCppInterOp.so"
16+
"lib@CPPINTEROP_TARGET@.so": "lib/lib@CPPINTEROP_TARGET@.so"
1717
}
1818
}
1919
}

share/jupyter/kernels/xcpp23/wasm_kernel.json.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"debugger": false,
1414
"shared": {
1515
"libxeus.so": "lib/libxeus.so",
16-
"libclangCppInterOp.so": "lib/libclangCppInterOp.so"
16+
"lib@CPPINTEROP_TARGET@.so": "lib/lib@CPPINTEROP_TARGET@.so"
1717
}
1818
}
1919
}

test/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ if(EMSCRIPTEN)
8181

8282
add_custom_command(TARGET test_xeus_cpp POST_BUILD
8383
COMMAND ${CMAKE_COMMAND} -E copy
84-
${CMAKE_INSTALL_PREFIX}/lib/libclangCppInterOp.so
85-
${CMAKE_CURRENT_BINARY_DIR}/libclangCppInterOp.so
86-
COMMENT "Copying libclangCppInterOp.so to the test directory"
84+
${CMAKE_INSTALL_PREFIX}/lib/lib${CPPINTEROP_TARGET}.so
85+
${CMAKE_CURRENT_BINARY_DIR}/lib${CPPINTEROP_TARGET}.so
86+
COMMENT "Copying lib${CPPINTEROP_TARGET}.so to the test directory"
8787
)
8888

8989
add_custom_command(TARGET test_xeus_cpp POST_BUILD

0 commit comments

Comments
 (0)