File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,23 @@ include(CMakeSystemSpecificInformation)
77set (CMAKE_FIND_PACKAGE_SORT_ORDER NATURAL)
88set (CMAKE_FIND_PACKAGE_SORT_DIRECTION DEC)
99
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+
1017add_library (cppyy-backend SHARED
1118 clingwrapper/src/clingwrapper.cxx
1219)
1320
21+ if (EMSCRIPTEN)
22+ target_link_options (cppyy-backend
23+ PUBLIC "SHELL: -s WASM_BIGINT"
24+ )
25+ endif ()
26+
1427# set_target_properties(cppyy-backend PROPERTIES VERSION ${PROJECT_VERSION})
1528
1629# 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 {
206206 g_builtins.insert (name+a);
207207 }
208208
209+ #ifndef __EMSCRIPTEN__
209210 // disable fast path if requested
210211 if (getenv (" CPPYY_DISABLE_FASTPATH" )) gEnableFastPath = false ;
211212
@@ -230,6 +231,7 @@ class ApplicationStarter {
230231 Cpp::AddIncludePath ((ClingBuildDir + " /include" ).c_str ());
231232 Cpp::AddIncludePath ((std::string (CPPINTEROP_DIR) + " /include" ).c_str ());
232233 Cpp::LoadLibrary (" libstdc++" , /* lookup= */ true );
234+ #endif
233235
234236 // load frequently used headers
235237 const char * code =
Original file line number Diff line number Diff line change 1919
2020if 'win32' in sys .platform :
2121 soext = '.dll'
22- elif 'linux' in sys .platform :
22+ elif 'linux' in sys .platform or 'emscripten' in sys . platform :
2323 soext = '.so'
2424else :
2525 soext = '.dylib'
You can’t perform that action at this time.
0 commit comments