From 620575f505b33e1a6f25277e2b4902cac37a0d25 Mon Sep 17 00:00:00 2001 From: Danny McClanahan <1305167+cosmicexplorer@users.noreply.github.com> Date: Wed, 20 Apr 2022 02:02:54 -0400 Subject: [PATCH] add emscripten compiler emcc, which can't compile executables (yet!) --- lib/spack/spack/compilers/emcc.py | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 lib/spack/spack/compilers/emcc.py diff --git a/lib/spack/spack/compilers/emcc.py b/lib/spack/spack/compilers/emcc.py new file mode 100644 index 00000000000..7806aaf3a74 --- /dev/null +++ b/lib/spack/spack/compilers/emcc.py @@ -0,0 +1,33 @@ +# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import os +import re + +import spack.compiler +from spack.version import ver + + +class Emcc(spack.compiler.Compiler): + cc_names = ['emcc'] + cxx_names = ['em++'] + + # Named wrapper links within build_env_path + link_paths = {'cc': os.path.join('upstream', 'emscripten', 'emcc'), + 'cxx': os.path.join('upstream', 'emscripten', 'em++'), + 'f77': '', + 'fc': ''} + + @property + def verbose_flag(self): + return "-v" + + @property + def debug_flags(self): + return ['-g', '-gsource-map', '-gseparate-dwarf', '-g0', '-g1', '-g2', '-g3'] + + @property + def opt_flags(self): + return ['-O0', '-O1', '-O2', '-O3', '-Os', '-Oz']