Skip to content

Commit 62f6ac7

Browse files
committed
Enable cling to be built with Emscripten
1 parent a1c112f commit 62f6ac7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

interpreter/cling/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ else()
118118
endif()
119119
endif()
120120

121-
if( NOT "NVPTX" IN_LIST LLVM_TARGETS_TO_BUILD)
121+
if( NOT "NVPTX" IN_LIST LLVM_TARGETS_TO_BUILD AND NOT EMSCRIPTEN)
122122
message(FATAL_ERROR "NVPTX backend is not activated\n"
123123
"Please enable it via -DLLVM_TARGETS_TO_BUILD=\"host;NVPTX\"")
124124
endif()

interpreter/cling/lib/Interpreter/IncrementalCUDADeviceCompiler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,13 @@ namespace cling {
9292
llvm::errs() << "Could not create PTX interpreter instance\n";
9393
return;
9494
}
95-
95+
#ifndef __EMSCRIPTEN__
9696
// initialize NVPTX backend
9797
LLVMInitializeNVPTXTargetInfo();
9898
LLVMInitializeNVPTXTarget();
9999
LLVMInitializeNVPTXTargetMC();
100100
LLVMInitializeNVPTXAsmPrinter();
101-
101+
#endif
102102
m_Init = true;
103103
}
104104

0 commit comments

Comments
 (0)