File tree 3 files changed +16
-1
lines changed
3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,23 @@ include(CMakeSystemSpecificInformation)
7
7
set (CMAKE_FIND_PACKAGE_SORT_ORDER NATURAL)
8
8
set (CMAKE_FIND_PACKAGE_SORT_DIRECTION DEC)
9
9
10
+ if (EMSCRIPTEN)
11
+ set_property (GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE )
12
+ set (CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-s SIDE_MODULE=1" )
13
+ set (CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-s SIDE_MODULE=1" )
14
+ set (CMAKE_STRIP FALSE )
15
+ endif ()
16
+
10
17
add_library (cppyy-backend SHARED
11
18
clingwrapper/src/clingwrapper.cxx
12
19
)
13
20
21
+ if (EMSCRIPTEN)
22
+ target_link_options (cppyy-backend
23
+ PUBLIC "SHELL: -s WASM_BIGINT"
24
+ )
25
+ endif ()
26
+
14
27
# set_target_properties(cppyy-backend PROPERTIES VERSION ${PROJECT_VERSION})
15
28
16
29
# set_target_properties(cppyy-backend PROPERTIES PUBLIC_HEADER include/cpp_cppyy.h)
Original file line number Diff line number Diff line change @@ -206,6 +206,7 @@ class ApplicationStarter {
206
206
g_builtins.insert (name+a);
207
207
}
208
208
209
+ #ifndef __EMSCRIPTEN__
209
210
// disable fast path if requested
210
211
if (getenv (" CPPYY_DISABLE_FASTPATH" )) gEnableFastPath = false ;
211
212
@@ -230,6 +231,7 @@ class ApplicationStarter {
230
231
Cpp::AddIncludePath ((ClingBuildDir + " /include" ).c_str ());
231
232
Cpp::AddIncludePath ((std::string (CPPINTEROP_DIR) + " /include" ).c_str ());
232
233
Cpp::LoadLibrary (" libstdc++" , /* lookup= */ true );
234
+ #endif
233
235
234
236
// load frequently used headers
235
237
const char * code =
Original file line number Diff line number Diff line change 19
19
20
20
if 'win32' in sys .platform :
21
21
soext = '.dll'
22
- elif 'linux' in sys .platform :
22
+ elif 'linux' in sys .platform or 'emscripten' in sys . platform :
23
23
soext = '.so'
24
24
else :
25
25
soext = '.dylib'
You can’t perform that action at this time.
0 commit comments