# Buggy code
def get_options(self):
    opts = {
        "cpp_std": coredata.UserComboOption(
            "cpp_std",
            "C++ language standard to use",
            [
                "none",
                "c++03",
                "c++11",
                "c++14",
                "c++1z",
                "gnu++03",
                "gnu++11",
                "gnu++14",
                "gnu++1z",
            ],
            "none",
        ),
        "cpp_debugstl": coredata.UserBooleanOption(
            "cpp_debugstl", "STL debug mode", False
        ),
    }
    if self.gcc_type == GCC_MINGW:
        opts.update(
            {
                "cpp_winlibs": coredata.UserStringArrayOption(
                    "c_winlibs", "Standard Win libraries to link against", gnu_winlibs
                ),
            }
        )
    return opts


# Traceback (KeyError)
The Meson build system
Version: 0.35.1
Source dir: F:\avian\test
Build dir: F:\avian\test\build\linux-64
Build type: cross build
Project name: avian                                                                                                 18:22Native cpp compiler: c++ (gcc 4.8.1)
Cross cpp compiler: f:/cygwin64/bin/x86_64-pc-linux-gnu-g++ (gcc 4.8.2)
Native c compiler: gcc (gcc 4.8.1)
Cross c compiler: f:/cygwin64/bin/x86_64-pc-linux-gnu-gcc (gcc 4.8.2)
Native java compiler: javac (unknown 1.8.0)
Cross java compiler: javac (unknown 1.8.0)
Host machine cpu family: x86_64
Host machine cpu: i686
Target machine cpu family: x86_64
Target machine cpu: i686
Build machine cpu family: x86_64
Build machine cpu: x86_64
Found pkg-config: f:\cygwin64\bin\pkg-config.EXE (0.29.1)
Cross dependency zlib found: YES 1.2.7
Checking for size of "void*": 8
Build targets in project: 2
Traceback (most recent call last):
File "c:\program files (x86)\python35-32\lib\site-packages\mesonbuild\mesonmain.py", line 282, in run
app.generate()
File "c:\program files (x86)\python35-32\lib\site-packages\mesonbuild\mesonmain.py", line 169, in generate
g.generate(intr)
File "c:\program files (x86)\python35-32\lib\site-packages\mesonbuild\backend\ninjabackend.py", line 187, in generate
self.generate_target(t, outfile)
File "c:\program files (x86)\python35-32\lib\site-packages\mesonbuild\backend\ninjabackend.py", line 355, in generate_target
elem = self.generate_link(target, outfile, outname, obj_list, linker, pch_objects)
File "c:\program files (x86)\python35-32\lib\site-packages\mesonbuild\backend\ninjabackend.py", line 1817, in generate_link
commands += linker.get_option_link_args(self.environment.coredata.compiler_options)
File "c:\program files (x86)\python35-32\lib\site-packages\mesonbuild\compilers.py", line 2027, in get_option_link_args

return options['cpp_winlibs'].value
KeyError: 'cpp_winlibs'

# Fixed code
def get_options(self):
    opts = {
        "cpp_std": coredata.UserComboOption(
            "cpp_std",
            "C++ language standard to use",
            [
                "none",
                "c++03",
                "c++11",
                "c++14",
                "c++1z",
                "gnu++03",
                "gnu++11",
                "gnu++14",
                "gnu++1z",
            ],
            "none",
        ),
        "cpp_debugstl": coredata.UserBooleanOption(
            "cpp_debugstl", "STL debug mode", False
        ),
    }
    if self.gcc_type == GCC_MINGW:
        opts.update(
            {
                "cpp_winlibs": coredata.UserStringArrayOption(
                    "cpp_winlibs", "Standard Win libraries to link against", gnu_winlibs
                ),
            }
        )
    return opts