@@ -120,67 +120,46 @@ if (NOT DEFINED XEUS_CPP_KERNELSPEC_PATH)
120
120
set (XEUS_CPP_KERNELSPEC_PATH "${CMAKE_INSTALL_PREFIX} /${CMAKE_INSTALL_BINDIR} /" )
121
121
endif ()
122
122
123
- function (configure_native_kernel kernel )
124
- set (XEUS_CPP_PATH "$ENV{PATH} " )
125
- set (XEUS_CPP_LD_LIBRARY_PATH "$ENV{LD_LIBRARY_PATH} " )
126
- set (XEUS_CPP_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX} /include )
127
-
123
+ function (configure_kernel kernel )
124
+ if (EMSCRIPTEN )
125
+ set (prefix "wasm_" )
126
+ else ()
127
+ set (XEUS_CPP_PATH "$ENV{PATH} " )
128
+ set (XEUS_CPP_LD_LIBRARY_PATH "$ENV{LD_LIBRARY_PATH} " )
129
+ set (XEUS_CPP_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX} /include )
130
+ endif ()
128
131
if (WIN32 )
129
132
string (REPLACE "\\ " "/" kernel "${kernel} " )
130
133
string (REPLACE "\\ " "/" XEUS_CPP_PATH "${XEUS_CPP_PATH} " )
131
134
string (REPLACE "\\ " "/" XEUS_CPP_LD_LIBRARY_PATH "${XEUS_CPP_LD_LIBRARY_PATH} " )
132
135
string (REPLACE "\\ " "/" XEUS_CPP_RESOURCE_DIR "${XEUS_CPP_RESOURCE_DIR} " )
133
136
string (REPLACE "\\ " "/" XEUS_CPP_INCLUDE_DIR "${XEUS_CPP_INCLUDE_DIR} " )
134
137
endif ()
135
-
136
- configure_file (
137
- "${CMAKE_CURRENT_SOURCE_DIR}${kernel} kernel.json.in"
138
- "${CMAKE_CURRENT_BINARY_DIR}${kernel} kernel.json" )
139
-
140
- configure_file (
141
- "${CMAKE_CURRENT_SOURCE_DIR}${kernel} logo-32x32.png"
142
- "${CMAKE_CURRENT_BINARY_DIR}${kernel} "
143
- COPYONLY )
144
- configure_file (
145
- "${CMAKE_CURRENT_SOURCE_DIR}${kernel} logo-64x64.png"
146
- "${CMAKE_CURRENT_BINARY_DIR}${kernel} "
147
- COPYONLY )
148
- configure_file (
149
- "${CMAKE_CURRENT_SOURCE_DIR}${kernel} logo-svg.svg"
150
- "${CMAKE_CURRENT_BINARY_DIR}${kernel} "
151
- COPYONLY )
152
- endfunction ()
153
-
154
- function (configure_wasm_kernel kernel )
155
-
156
- configure_file (
157
- "${CMAKE_CURRENT_SOURCE_DIR}${kernel} wasm_kernel.json.in"
158
- "${CMAKE_CURRENT_BINARY_DIR}${kernel} kernel.json" )
159
-
160
- configure_file (
138
+ configure_file (
139
+ "${CMAKE_CURRENT_SOURCE_DIR}${kernel}${prefix} kernel.json.in"
140
+ "${CMAKE_CURRENT_BINARY_DIR}${kernel} kernel.json"
141
+ )
142
+ configure_file (
161
143
"${CMAKE_CURRENT_SOURCE_DIR}${kernel} logo-32x32.png"
162
144
"${CMAKE_CURRENT_BINARY_DIR}${kernel} "
163
- COPYONLY )
164
- configure_file (
145
+ COPYONLY
146
+ )
147
+ configure_file (
165
148
"${CMAKE_CURRENT_SOURCE_DIR}${kernel} logo-64x64.png"
166
149
"${CMAKE_CURRENT_BINARY_DIR}${kernel} "
167
- COPYONLY )
168
- configure_file (
150
+ COPYONLY
151
+ )
152
+ configure_file (
169
153
"${CMAKE_CURRENT_SOURCE_DIR}${kernel} logo-svg.svg"
170
154
"${CMAKE_CURRENT_BINARY_DIR}${kernel} "
171
- COPYONLY )
155
+ COPYONLY
156
+ )
172
157
endfunction ()
173
158
174
159
message ("Configure kernels: ..." )
175
- if (EMSCRIPTEN )
176
- configure_wasm_kernel ("/share/jupyter/kernels/xcpp17/" )
177
- configure_wasm_kernel ("/share/jupyter/kernels/xcpp20/" )
178
- configure_wasm_kernel ("/share/jupyter/kernels/xcpp23/" )
179
- else ()
180
- configure_native_kernel ("/share/jupyter/kernels/xcpp17/" )
181
- configure_native_kernel ("/share/jupyter/kernels/xcpp20/" )
182
- configure_native_kernel ("/share/jupyter/kernels/xcpp23/" )
183
- endif ()
160
+ configure_kernel ("/share/jupyter/kernels/xcpp17/" )
161
+ configure_kernel ("/share/jupyter/kernels/xcpp20/" )
162
+ configure_kernel ("/share/jupyter/kernels/xcpp23/" )
184
163
185
164
# Source files
186
165
# ============
0 commit comments