Skip to content

Commit cdf3db6

Browse files
anutosh491Gnimuc
authored andcommitted
Export __clang_Interpreter_SetValueNoAlloc to allow automatic printf in xeus-cpp-lite
1 parent 1689434 commit cdf3db6

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

lib/Interpreter/CMakeLists.txt

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
if(EMSCRIPTEN)
22
set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
3-
set(LLVM_LINK_COMPONENTS "")
3+
set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-s SIDE_MODULE=1")
4+
set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-s SIDE_MODULE=1")
5+
set(CMAKE_STRIP FALSE)
6+
7+
add_llvm_library(clangCppInterOp
8+
SHARED
9+
10+
CppInterOp.cpp
11+
CXCppInterOp.cpp
12+
DynamicLibraryManager.cpp
13+
DynamicLibraryManagerSymbol.cpp
14+
Paths.cpp
15+
16+
# Additional libraries from Clang and LLD
17+
LINK_LIBS
18+
clangInterpreter
19+
)
20+
target_link_options(clangCppInterOp PRIVATE
21+
PUBLIC "SHELL: -s WASM_BIGINT"
22+
PUBLIC "SHELL: -Wl,--export=__clang_Interpreter_SetValueNoAlloc"
23+
)
424
else()
525
set(LLVM_LINK_COMPONENTS
626
${LLVM_TARGETS_TO_BUILD}

0 commit comments

Comments
 (0)