Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 44c0dde

Browse files
zhuoweiMaxDesiatov
authored andcommitted
hack: define __EMSCRIPTEN__ when compiling to wasm
Too lazy to backport the Emscripten target to this version of LLVM
1 parent c78bf87 commit 44c0dde

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/Basic/Targets/WebAssembly.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ void WebAssemblyTargetInfo::fillValidCPUList(
6060
void WebAssemblyTargetInfo::getTargetDefines(const LangOptions &Opts,
6161
MacroBuilder &Builder) const {
6262
defineCPUMacros(Builder, "wasm", /*Tuning=*/false);
63+
// HACK: too lazy to backport the -emscripten target here
64+
Builder.defineMacro("__EMSCRIPTEN__");
6365
if (SIMDLevel >= SIMD128)
6466
Builder.defineMacro("__wasm_simd128__");
6567
if (SIMDLevel >= UnimplementedSIMD128)

0 commit comments

Comments
 (0)