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

Commit 7e41ca9

Browse files
committed
hack: define __EMSCRIPTEN__ when compiling to wasm
Too lazy to backport the Emscripten target to this version of LLVM
1 parent 8f27436 commit 7e41ca9

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
@@ -53,6 +53,8 @@ void WebAssemblyTargetInfo::fillValidCPUList(
5353
void WebAssemblyTargetInfo::getTargetDefines(const LangOptions &Opts,
5454
MacroBuilder &Builder) const {
5555
defineCPUMacros(Builder, "wasm", /*Tuning=*/false);
56+
// HACK: too lazy to backport the -emscripten target here
57+
Builder.defineMacro("__EMSCRIPTEN__");
5658
if (SIMDLevel >= SIMD128)
5759
Builder.defineMacro("__wasm_simd128__");
5860
}

0 commit comments

Comments
 (0)