@@ -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,30 @@ function(configure_kernel kernel)
148148 COPYONLY )
149149endfunction ()
150150
151+ function (configure_wasm_kernel kernel)
152+ set (XEUS_CPP_PATH "$ENV{PATH} " )
153+ set (XEUS_CPP_LD_LIBRARY_PATH "$ENV{LD_LIBRARY_PATH} " )
154+ set (XEUS_CPP_RESOURCE_DIR ${CMAKE_INSTALL_PREFIX} /${CMAKE_INSTALL_LIBDIR} /clang/${CPPINTEROP_LLVM_VERSION_MAJOR} )
155+ set (XEUS_CPP_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX} /include )
156+
157+ configure_file (
158+ "${CMAKE_CURRENT_SOURCE_DIR}${kernel} wasm_kernel.json.in"
159+ "${CMAKE_CURRENT_BINARY_DIR}${kernel} kernel.json" )
160+
161+ configure_file (
162+ "${CMAKE_CURRENT_SOURCE_DIR}${kernel} logo-32x32.png"
163+ "${CMAKE_CURRENT_BINARY_DIR}${kernel} "
164+ COPYONLY )
165+ configure_file (
166+ "${CMAKE_CURRENT_SOURCE_DIR}${kernel} logo-64x64.png"
167+ "${CMAKE_CURRENT_BINARY_DIR}${kernel} "
168+ COPYONLY )
169+ configure_file (
170+ "${CMAKE_CURRENT_SOURCE_DIR}${kernel} logo-svg.svg"
171+ "${CMAKE_CURRENT_BINARY_DIR}${kernel} "
172+ COPYONLY )
173+ endfunction ()
174+
151175message ("Configure kernels: ..." )
152176if (EMSCRIPTEN)
153177 # TODO: Currently jupyterlite-xeus and xeus-lite do not provide
@@ -160,10 +184,10 @@ if(EMSCRIPTEN)
160184 # to be able to deal with arguments present in kernel.json
161185 # 3) Finally we should fetch the C++ version from the kernel.json file and
162186 # be able to pass it to our wasm interpreter rather than forcing a version.
163- configure_kernel ("/share/jupyter/kernels/xcpp20/" )
187+ configure_wasm_kernel ("/share/jupyter/kernels/xcpp20/" )
164188else ()
165- configure_kernel ("/share/jupyter/kernels/xcpp17/" )
166- configure_kernel ("/share/jupyter/kernels/xcpp20/" )
189+ configure_native_kernel ("/share/jupyter/kernels/xcpp17/" )
190+ configure_native_kernel ("/share/jupyter/kernels/xcpp20/" )
167191endif ()
168192
169193# Source files
0 commit comments