@@ -116,7 +116,7 @@ if (NOT DEFINED XEUS_CPP_KERNELSPEC_PATH)
116116 set (XEUS_CPP_KERNELSPEC_PATH "${CMAKE_INSTALL_PREFIX} /${CMAKE_INSTALL_BINDIR} /" )
117117endif ()
118118
119- function (configure_kernel kernel)
119+ function (configure_native_kernel kernel)
120120 set (XEUS_CPP_PATH "$ENV{PATH} " )
121121 set (XEUS_CPP_LD_LIBRARY_PATH "$ENV{LD_LIBRARY_PATH} " )
122122 set (XEUS_CPP_RESOURCE_DIR ${CMAKE_INSTALL_PREFIX} /${CMAKE_INSTALL_LIBDIR} /clang/${CPPINTEROP_LLVM_VERSION_MAJOR} )
@@ -148,6 +148,26 @@ function(configure_kernel kernel)
148148 COPYONLY )
149149endfunction ()
150150
151+ function (configure_wasm_kernel kernel)
152+
153+ configure_file (
154+ "${CMAKE_CURRENT_SOURCE_DIR}${kernel} wasm_kernel.json.in"
155+ "${CMAKE_CURRENT_BINARY_DIR}${kernel} kernel.json" )
156+
157+ configure_file (
158+ "${CMAKE_CURRENT_SOURCE_DIR}${kernel} logo-32x32.png"
159+ "${CMAKE_CURRENT_BINARY_DIR}${kernel} "
160+ COPYONLY )
161+ configure_file (
162+ "${CMAKE_CURRENT_SOURCE_DIR}${kernel} logo-64x64.png"
163+ "${CMAKE_CURRENT_BINARY_DIR}${kernel} "
164+ COPYONLY )
165+ configure_file (
166+ "${CMAKE_CURRENT_SOURCE_DIR}${kernel} logo-svg.svg"
167+ "${CMAKE_CURRENT_BINARY_DIR}${kernel} "
168+ COPYONLY )
169+ endfunction ()
170+
151171message ("Configure kernels: ..." )
152172if (EMSCRIPTEN)
153173 # TODO: Currently jupyterlite-xeus and xeus-lite do not provide
@@ -160,10 +180,10 @@ if(EMSCRIPTEN)
160180 # to be able to deal with arguments present in kernel.json
161181 # 3) Finally we should fetch the C++ version from the kernel.json file and
162182 # be able to pass it to our wasm interpreter rather than forcing a version.
163- configure_kernel ("/share/jupyter/kernels/xcpp20/" )
183+ configure_wasm_kernel ("/share/jupyter/kernels/xcpp20/" )
164184else ()
165- configure_kernel ("/share/jupyter/kernels/xcpp17/" )
166- configure_kernel ("/share/jupyter/kernels/xcpp20/" )
185+ configure_native_kernel ("/share/jupyter/kernels/xcpp17/" )
186+ configure_native_kernel ("/share/jupyter/kernels/xcpp20/" )
167187endif ()
168188
169189# Source files
0 commit comments