We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Value "gnu89" (of type "string") for combo option "C language standard to use" is not one of the choices. Possible choices are (as string): "none", "c89", "c99", "c11", "c17", "gnu99", "gnu11".
Building glib2 2.62.6 with meson 0.59.1 fails:

```
Value "gnu89" (of type "string") for combo option "C language standard to use" is not one of the choices. Possible choices are (as string): "none", "c89", "c99", "c11", "c17", "gnu99", "gnu11".
```

With meson 0.58.1 there was no such error.

See https://trac.macports.org/ticket/63462

In #8766 gnu99 and gnu11 were added to the list of possible choices but for some reason gnu89 was not added? Could you add it, please?

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `mesonbuild/compilers/objc.py`
Content:
```
1 # Copyright 2012-2017 The Meson development team
2 
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 
15 import typing as T
16 
17 from .. import coredata
18 from ..mesonlib import MachineChoice, OptionKey
19 
20 from .compilers import Compiler
21 from .mixins.clike import CLikeCompiler
22 from .mixins.gnu import GnuCompiler
23 from .mixins.clang import ClangCompiler
24 
25 if T.TYPE_CHECKING:
26     from ..programs import ExternalProgram
27     from ..envconfig import MachineInfo
28     from ..environment import Environment
29     from ..linkers import DynamicLinker
30 
31 
32 class ObjCCompiler(CLikeCompiler, Compiler):
33 
34     language = 'objc'
35 
36     def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,
37                  is_cross: bool, info: 'MachineInfo',
38                  exe_wrap: T.Optional['ExternalProgram'],
39                  linker: T.Optional['DynamicLinker'] = None,
40                  full_version: T.Optional[str] = None):
41         Compiler.__init__(self, exelist, version, for_machine, info,
42                           is_cross=is_cross, full_version=full_version,
43                           linker=linker)
44         CLikeCompiler.__init__(self, exe_wrap)
45 
46     @staticmethod
47     def get_display_language() -> str:
48         return 'Objective-C'
49 
50     def sanity_check(self, work_dir: str, environment: 'Environment') -> None:
51         code = '#import<stddef.h>\nint main(void) { return 0; }\n'
52         return self._sanity_check_impl(work_dir, environment, 'sanitycheckobjc.m', code)
53 
54 
55 class GnuObjCCompiler(GnuCompiler, ObjCCompiler):
56     def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,
57                  is_cross: bool, info: 'MachineInfo',
58                  exe_wrapper: T.Optional['ExternalProgram'] = None,
59                  defines: T.Optional[T.Dict[str, str]] = None,
60                  linker: T.Optional['DynamicLinker'] = None,
61                  full_version: T.Optional[str] = None):
62         ObjCCompiler.__init__(self, exelist, version, for_machine, is_cross,
63                               info, exe_wrapper, linker=linker, full_version=full_version)
64         GnuCompiler.__init__(self, defines)
65         default_warn_args = ['-Wall', '-Winvalid-pch']
66         self.warn_args = {'0': [],
67                           '1': default_warn_args,
68                           '2': default_warn_args + ['-Wextra'],
69                           '3': default_warn_args + ['-Wextra', '-Wpedantic']}
70 
71 
72 class ClangObjCCompiler(ClangCompiler, ObjCCompiler):
73     def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,
74                  is_cross: bool, info: 'MachineInfo',
75                  exe_wrapper: T.Optional['ExternalProgram'] = None,
76                  defines: T.Optional[T.Dict[str, str]] = None,
77                  linker: T.Optional['DynamicLinker'] = None,
78                  full_version: T.Optional[str] = None):
79         ObjCCompiler.__init__(self, exelist, version, for_machine, is_cross,
80                               info, exe_wrapper, linker=linker, full_version=full_version)
81         ClangCompiler.__init__(self, defines)
82         default_warn_args = ['-Wall', '-Winvalid-pch']
83         self.warn_args = {'0': [],
84                           '1': default_warn_args,
85                           '2': default_warn_args + ['-Wextra'],
86                           '3': default_warn_args + ['-Wextra', '-Wpedantic']}
87 
88     def get_options(self) -> 'coredata.KeyedOptionDictType':
89         opts = super().get_options()
90         opts.update({
91             OptionKey('std', machine=self.for_machine, lang='c'): coredata.UserComboOption(
92                 'C language standard to use',
93                 ['none', 'c89', 'c99', 'c11', 'c17', 'gnu99', 'gnu11'],
94                 'none',
95             )
96         })
97         return opts
98 
99     def get_option_compile_args(self, options: 'coredata.KeyedOptionDictType') -> T.List[str]:
100         args = []
101         std = options[OptionKey('std', machine=self.for_machine, lang='c')]
102         if std.value != 'none':
103             args.append('-std=' + std.value)
104         return args
105 
106 class AppleClangObjCCompiler(ClangObjCCompiler):
107 
108     """Handle the differences between Apple's clang and vanilla clang."""
109
```

Path: `mesonbuild/compilers/objcpp.py`
Content:
```
1 # Copyright 2012-2017 The Meson development team
2 
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 
15 import typing as T
16 
17 from .. import coredata
18 from ..mesonlib import MachineChoice, OptionKey
19 
20 from .mixins.clike import CLikeCompiler
21 from .compilers import Compiler
22 from .mixins.gnu import GnuCompiler
23 from .mixins.clang import ClangCompiler
24 
25 if T.TYPE_CHECKING:
26     from ..programs import ExternalProgram
27     from ..envconfig import MachineInfo
28     from ..environment import Environment
29     from ..linkers import DynamicLinker
30 
31 class ObjCPPCompiler(CLikeCompiler, Compiler):
32 
33     language = 'objcpp'
34 
35     def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,
36                  is_cross: bool, info: 'MachineInfo',
37                  exe_wrap: T.Optional['ExternalProgram'],
38                  linker: T.Optional['DynamicLinker'] = None,
39                  full_version: T.Optional[str] = None):
40         Compiler.__init__(self, exelist, version, for_machine, info,
41                           is_cross=is_cross, full_version=full_version,
42                           linker=linker)
43         CLikeCompiler.__init__(self, exe_wrap)
44 
45     @staticmethod
46     def get_display_language() -> str:
47         return 'Objective-C++'
48 
49     def sanity_check(self, work_dir: str, environment: 'Environment') -> None:
50         code = '#import<stdio.h>\nclass MyClass;int main(void) { return 0; }\n'
51         return self._sanity_check_impl(work_dir, environment, 'sanitycheckobjcpp.mm', code)
52 
53 
54 class GnuObjCPPCompiler(GnuCompiler, ObjCPPCompiler):
55     def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,
56                  is_cross: bool, info: 'MachineInfo',
57                  exe_wrapper: T.Optional['ExternalProgram'] = None,
58                  defines: T.Optional[T.Dict[str, str]] = None,
59                  linker: T.Optional['DynamicLinker'] = None,
60                  full_version: T.Optional[str] = None):
61         ObjCPPCompiler.__init__(self, exelist, version, for_machine, is_cross,
62                               info, exe_wrapper, linker=linker, full_version=full_version)
63         GnuCompiler.__init__(self, defines)
64         default_warn_args = ['-Wall', '-Winvalid-pch', '-Wnon-virtual-dtor']
65         self.warn_args = {'0': [],
66                           '1': default_warn_args,
67                           '2': default_warn_args + ['-Wextra'],
68                           '3': default_warn_args + ['-Wextra', '-Wpedantic']}
69 
70 
71 class ClangObjCPPCompiler(ClangCompiler, ObjCPPCompiler):
72 
73     def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,
74                  is_cross: bool, info: 'MachineInfo',
75                  exe_wrapper: T.Optional['ExternalProgram'] = None,
76                  defines: T.Optional[T.Dict[str, str]] = None,
77                  linker: T.Optional['DynamicLinker'] = None,
78                  full_version: T.Optional[str] = None):
79         ObjCPPCompiler.__init__(self, exelist, version, for_machine, is_cross,
80                               info, exe_wrapper, linker=linker, full_version=full_version)
81         ClangCompiler.__init__(self, defines)
82         default_warn_args = ['-Wall', '-Winvalid-pch', '-Wnon-virtual-dtor']
83         self.warn_args = {'0': [],
84                           '1': default_warn_args,
85                           '2': default_warn_args + ['-Wextra'],
86                           '3': default_warn_args + ['-Wextra', '-Wpedantic']}
87 
88 
89     def get_options(self) -> 'coredata.KeyedOptionDictType':
90         opts = super().get_options()
91         opts.update({
92             OptionKey('std', machine=self.for_machine, lang='cpp'): coredata.UserComboOption(
93                 'C++ language standard to use',
94                 ['none', 'c++98', 'c++11', 'c++14', 'c++17'],
95                 'none',
96             )
97         })
98         return opts
99 
100     def get_option_compile_args(self, options: 'coredata.KeyedOptionDictType') -> T.List[str]:
101         args = []
102         std = options[OptionKey('std', machine=self.for_machine, lang='cpp')]
103         if std.value != 'none':
104             args.append('-std=' + std.value)
105         return args
106 
107 
108 class AppleClangObjCPPCompiler(ClangObjCPPCompiler):
109 
110     """Handle the differences between Apple's clang and vanilla clang."""
111
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/mesonbuild/compilers/objc.py b/mesonbuild/compilers/objc.py
--- a/mesonbuild/compilers/objc.py
+++ b/mesonbuild/compilers/objc.py
@@ -90,7 +90,7 @@
         opts.update({
             OptionKey('std', machine=self.for_machine, lang='c'): coredata.UserComboOption(
                 'C language standard to use',
-                ['none', 'c89', 'c99', 'c11', 'c17', 'gnu99', 'gnu11'],
+                ['none', 'c89', 'c99', 'c11', 'c17', 'gnu89', 'gnu99', 'gnu11', 'gnu17'],
                 'none',
             )
         })
diff --git a/mesonbuild/compilers/objcpp.py b/mesonbuild/compilers/objcpp.py
--- a/mesonbuild/compilers/objcpp.py
+++ b/mesonbuild/compilers/objcpp.py
@@ -91,7 +91,7 @@
         opts.update({
             OptionKey('std', machine=self.for_machine, lang='cpp'): coredata.UserComboOption(
                 'C++ language standard to use',
-                ['none', 'c++98', 'c++11', 'c++14', 'c++17'],
+                ['none', 'c++98', 'c++11', 'c++14', 'c++17', 'gnu++98', 'gnu++11', 'gnu++14', 'gnu++17'],
                 'none',
             )
         })

{"golden_diff": "diff --git a/mesonbuild/compilers/objc.py b/mesonbuild/compilers/objc.py\n--- a/mesonbuild/compilers/objc.py\n+++ b/mesonbuild/compilers/objc.py\n@@ -90,7 +90,7 @@\n         opts.update({\n             OptionKey('std', machine=self.for_machine, lang='c'): coredata.UserComboOption(\n                 'C language standard to use',\n-                ['none', 'c89', 'c99', 'c11', 'c17', 'gnu99', 'gnu11'],\n+                ['none', 'c89', 'c99', 'c11', 'c17', 'gnu89', 'gnu99', 'gnu11', 'gnu17'],\n                 'none',\n             )\n         })\ndiff --git a/mesonbuild/compilers/objcpp.py b/mesonbuild/compilers/objcpp.py\n--- a/mesonbuild/compilers/objcpp.py\n+++ b/mesonbuild/compilers/objcpp.py\n@@ -91,7 +91,7 @@\n         opts.update({\n             OptionKey('std', machine=self.for_machine, lang='cpp'): coredata.UserComboOption(\n                 'C++ language standard to use',\n-                ['none', 'c++98', 'c++11', 'c++14', 'c++17'],\n+                ['none', 'c++98', 'c++11', 'c++14', 'c++17', 'gnu++98', 'gnu++11', 'gnu++14', 'gnu++17'],\n                 'none',\n             )\n         })\n", "issue": "Value \"gnu89\" (of type \"string\") for combo option \"C language standard to use\" is not one of the choices. Possible choices are (as string): \"none\", \"c89\", \"c99\", \"c11\", \"c17\", \"gnu99\", \"gnu11\".\nBuilding glib2 2.62.6 with meson 0.59.1 fails:\r\n\r\n```\r\nValue \"gnu89\" (of type \"string\") for combo option \"C language standard to use\" is not one of the choices. Possible choices are (as string): \"none\", \"c89\", \"c99\", \"c11\", \"c17\", \"gnu99\", \"gnu11\".\r\n```\r\n\r\nWith meson 0.58.1 there was no such error.\r\n\r\nSee https://trac.macports.org/ticket/63462\r\n\r\nIn #8766 gnu99 and gnu11 were added to the list of possible choices but for some reason gnu89 was not added? Could you add it, please?\n", "before_files": [{"content": "# Copyright 2012-2017 The Meson development team\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n#     http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport typing as T\n\nfrom .. import coredata\nfrom ..mesonlib import MachineChoice, OptionKey\n\nfrom .compilers import Compiler\nfrom .mixins.clike import CLikeCompiler\nfrom .mixins.gnu import GnuCompiler\nfrom .mixins.clang import ClangCompiler\n\nif T.TYPE_CHECKING:\n    from ..programs import ExternalProgram\n    from ..envconfig import MachineInfo\n    from ..environment import Environment\n    from ..linkers import DynamicLinker\n\n\nclass ObjCCompiler(CLikeCompiler, Compiler):\n\n    language = 'objc'\n\n    def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,\n                 is_cross: bool, info: 'MachineInfo',\n                 exe_wrap: T.Optional['ExternalProgram'],\n                 linker: T.Optional['DynamicLinker'] = None,\n                 full_version: T.Optional[str] = None):\n        Compiler.__init__(self, exelist, version, for_machine, info,\n                          is_cross=is_cross, full_version=full_version,\n                          linker=linker)\n        CLikeCompiler.__init__(self, exe_wrap)\n\n    @staticmethod\n    def get_display_language() -> str:\n        return 'Objective-C'\n\n    def sanity_check(self, work_dir: str, environment: 'Environment') -> None:\n        code = '#import<stddef.h>\\nint main(void) { return 0; }\\n'\n        return self._sanity_check_impl(work_dir, environment, 'sanitycheckobjc.m', code)\n\n\nclass GnuObjCCompiler(GnuCompiler, ObjCCompiler):\n    def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,\n                 is_cross: bool, info: 'MachineInfo',\n                 exe_wrapper: T.Optional['ExternalProgram'] = None,\n                 defines: T.Optional[T.Dict[str, str]] = None,\n                 linker: T.Optional['DynamicLinker'] = None,\n                 full_version: T.Optional[str] = None):\n        ObjCCompiler.__init__(self, exelist, version, for_machine, is_cross,\n                              info, exe_wrapper, linker=linker, full_version=full_version)\n        GnuCompiler.__init__(self, defines)\n        default_warn_args = ['-Wall', '-Winvalid-pch']\n        self.warn_args = {'0': [],\n                          '1': default_warn_args,\n                          '2': default_warn_args + ['-Wextra'],\n                          '3': default_warn_args + ['-Wextra', '-Wpedantic']}\n\n\nclass ClangObjCCompiler(ClangCompiler, ObjCCompiler):\n    def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,\n                 is_cross: bool, info: 'MachineInfo',\n                 exe_wrapper: T.Optional['ExternalProgram'] = None,\n                 defines: T.Optional[T.Dict[str, str]] = None,\n                 linker: T.Optional['DynamicLinker'] = None,\n                 full_version: T.Optional[str] = None):\n        ObjCCompiler.__init__(self, exelist, version, for_machine, is_cross,\n                              info, exe_wrapper, linker=linker, full_version=full_version)\n        ClangCompiler.__init__(self, defines)\n        default_warn_args = ['-Wall', '-Winvalid-pch']\n        self.warn_args = {'0': [],\n                          '1': default_warn_args,\n                          '2': default_warn_args + ['-Wextra'],\n                          '3': default_warn_args + ['-Wextra', '-Wpedantic']}\n\n    def get_options(self) -> 'coredata.KeyedOptionDictType':\n        opts = super().get_options()\n        opts.update({\n            OptionKey('std', machine=self.for_machine, lang='c'): coredata.UserComboOption(\n                'C language standard to use',\n                ['none', 'c89', 'c99', 'c11', 'c17', 'gnu99', 'gnu11'],\n                'none',\n            )\n        })\n        return opts\n\n    def get_option_compile_args(self, options: 'coredata.KeyedOptionDictType') -> T.List[str]:\n        args = []\n        std = options[OptionKey('std', machine=self.for_machine, lang='c')]\n        if std.value != 'none':\n            args.append('-std=' + std.value)\n        return args\n\nclass AppleClangObjCCompiler(ClangObjCCompiler):\n\n    \"\"\"Handle the differences between Apple's clang and vanilla clang.\"\"\"\n", "path": "mesonbuild/compilers/objc.py"}, {"content": "# Copyright 2012-2017 The Meson development team\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n#     http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport typing as T\n\nfrom .. import coredata\nfrom ..mesonlib import MachineChoice, OptionKey\n\nfrom .mixins.clike import CLikeCompiler\nfrom .compilers import Compiler\nfrom .mixins.gnu import GnuCompiler\nfrom .mixins.clang import ClangCompiler\n\nif T.TYPE_CHECKING:\n    from ..programs import ExternalProgram\n    from ..envconfig import MachineInfo\n    from ..environment import Environment\n    from ..linkers import DynamicLinker\n\nclass ObjCPPCompiler(CLikeCompiler, Compiler):\n\n    language = 'objcpp'\n\n    def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,\n                 is_cross: bool, info: 'MachineInfo',\n                 exe_wrap: T.Optional['ExternalProgram'],\n                 linker: T.Optional['DynamicLinker'] = None,\n                 full_version: T.Optional[str] = None):\n        Compiler.__init__(self, exelist, version, for_machine, info,\n                          is_cross=is_cross, full_version=full_version,\n                          linker=linker)\n        CLikeCompiler.__init__(self, exe_wrap)\n\n    @staticmethod\n    def get_display_language() -> str:\n        return 'Objective-C++'\n\n    def sanity_check(self, work_dir: str, environment: 'Environment') -> None:\n        code = '#import<stdio.h>\\nclass MyClass;int main(void) { return 0; }\\n'\n        return self._sanity_check_impl(work_dir, environment, 'sanitycheckobjcpp.mm', code)\n\n\nclass GnuObjCPPCompiler(GnuCompiler, ObjCPPCompiler):\n    def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,\n                 is_cross: bool, info: 'MachineInfo',\n                 exe_wrapper: T.Optional['ExternalProgram'] = None,\n                 defines: T.Optional[T.Dict[str, str]] = None,\n                 linker: T.Optional['DynamicLinker'] = None,\n                 full_version: T.Optional[str] = None):\n        ObjCPPCompiler.__init__(self, exelist, version, for_machine, is_cross,\n                              info, exe_wrapper, linker=linker, full_version=full_version)\n        GnuCompiler.__init__(self, defines)\n        default_warn_args = ['-Wall', '-Winvalid-pch', '-Wnon-virtual-dtor']\n        self.warn_args = {'0': [],\n                          '1': default_warn_args,\n                          '2': default_warn_args + ['-Wextra'],\n                          '3': default_warn_args + ['-Wextra', '-Wpedantic']}\n\n\nclass ClangObjCPPCompiler(ClangCompiler, ObjCPPCompiler):\n\n    def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,\n                 is_cross: bool, info: 'MachineInfo',\n                 exe_wrapper: T.Optional['ExternalProgram'] = None,\n                 defines: T.Optional[T.Dict[str, str]] = None,\n                 linker: T.Optional['DynamicLinker'] = None,\n                 full_version: T.Optional[str] = None):\n        ObjCPPCompiler.__init__(self, exelist, version, for_machine, is_cross,\n                              info, exe_wrapper, linker=linker, full_version=full_version)\n        ClangCompiler.__init__(self, defines)\n        default_warn_args = ['-Wall', '-Winvalid-pch', '-Wnon-virtual-dtor']\n        self.warn_args = {'0': [],\n                          '1': default_warn_args,\n                          '2': default_warn_args + ['-Wextra'],\n                          '3': default_warn_args + ['-Wextra', '-Wpedantic']}\n\n\n    def get_options(self) -> 'coredata.KeyedOptionDictType':\n        opts = super().get_options()\n        opts.update({\n            OptionKey('std', machine=self.for_machine, lang='cpp'): coredata.UserComboOption(\n                'C++ language standard to use',\n                ['none', 'c++98', 'c++11', 'c++14', 'c++17'],\n                'none',\n            )\n        })\n        return opts\n\n    def get_option_compile_args(self, options: 'coredata.KeyedOptionDictType') -> T.List[str]:\n        args = []\n        std = options[OptionKey('std', machine=self.for_machine, lang='cpp')]\n        if std.value != 'none':\n            args.append('-std=' + std.value)\n        return args\n\n\nclass AppleClangObjCPPCompiler(ClangObjCPPCompiler):\n\n    \"\"\"Handle the differences between Apple's clang and vanilla clang.\"\"\"\n", "path": "mesonbuild/compilers/objcpp.py"}], "after_files": [{"content": "# Copyright 2012-2017 The Meson development team\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n#     http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport typing as T\n\nfrom .. import coredata\nfrom ..mesonlib import MachineChoice, OptionKey\n\nfrom .compilers import Compiler\nfrom .mixins.clike import CLikeCompiler\nfrom .mixins.gnu import GnuCompiler\nfrom .mixins.clang import ClangCompiler\n\nif T.TYPE_CHECKING:\n    from ..programs import ExternalProgram\n    from ..envconfig import MachineInfo\n    from ..environment import Environment\n    from ..linkers import DynamicLinker\n\n\nclass ObjCCompiler(CLikeCompiler, Compiler):\n\n    language = 'objc'\n\n    def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,\n                 is_cross: bool, info: 'MachineInfo',\n                 exe_wrap: T.Optional['ExternalProgram'],\n                 linker: T.Optional['DynamicLinker'] = None,\n                 full_version: T.Optional[str] = None):\n        Compiler.__init__(self, exelist, version, for_machine, info,\n                          is_cross=is_cross, full_version=full_version,\n                          linker=linker)\n        CLikeCompiler.__init__(self, exe_wrap)\n\n    @staticmethod\n    def get_display_language() -> str:\n        return 'Objective-C'\n\n    def sanity_check(self, work_dir: str, environment: 'Environment') -> None:\n        code = '#import<stddef.h>\\nint main(void) { return 0; }\\n'\n        return self._sanity_check_impl(work_dir, environment, 'sanitycheckobjc.m', code)\n\n\nclass GnuObjCCompiler(GnuCompiler, ObjCCompiler):\n    def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,\n                 is_cross: bool, info: 'MachineInfo',\n                 exe_wrapper: T.Optional['ExternalProgram'] = None,\n                 defines: T.Optional[T.Dict[str, str]] = None,\n                 linker: T.Optional['DynamicLinker'] = None,\n                 full_version: T.Optional[str] = None):\n        ObjCCompiler.__init__(self, exelist, version, for_machine, is_cross,\n                              info, exe_wrapper, linker=linker, full_version=full_version)\n        GnuCompiler.__init__(self, defines)\n        default_warn_args = ['-Wall', '-Winvalid-pch']\n        self.warn_args = {'0': [],\n                          '1': default_warn_args,\n                          '2': default_warn_args + ['-Wextra'],\n                          '3': default_warn_args + ['-Wextra', '-Wpedantic']}\n\n\nclass ClangObjCCompiler(ClangCompiler, ObjCCompiler):\n    def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,\n                 is_cross: bool, info: 'MachineInfo',\n                 exe_wrapper: T.Optional['ExternalProgram'] = None,\n                 defines: T.Optional[T.Dict[str, str]] = None,\n                 linker: T.Optional['DynamicLinker'] = None,\n                 full_version: T.Optional[str] = None):\n        ObjCCompiler.__init__(self, exelist, version, for_machine, is_cross,\n                              info, exe_wrapper, linker=linker, full_version=full_version)\n        ClangCompiler.__init__(self, defines)\n        default_warn_args = ['-Wall', '-Winvalid-pch']\n        self.warn_args = {'0': [],\n                          '1': default_warn_args,\n                          '2': default_warn_args + ['-Wextra'],\n                          '3': default_warn_args + ['-Wextra', '-Wpedantic']}\n\n    def get_options(self) -> 'coredata.KeyedOptionDictType':\n        opts = super().get_options()\n        opts.update({\n            OptionKey('std', machine=self.for_machine, lang='c'): coredata.UserComboOption(\n                'C language standard to use',\n                ['none', 'c89', 'c99', 'c11', 'c17', 'gnu89', 'gnu99', 'gnu11', 'gnu17'],\n                'none',\n            )\n        })\n        return opts\n\n    def get_option_compile_args(self, options: 'coredata.KeyedOptionDictType') -> T.List[str]:\n        args = []\n        std = options[OptionKey('std', machine=self.for_machine, lang='c')]\n        if std.value != 'none':\n            args.append('-std=' + std.value)\n        return args\n\nclass AppleClangObjCCompiler(ClangObjCCompiler):\n\n    \"\"\"Handle the differences between Apple's clang and vanilla clang.\"\"\"\n", "path": "mesonbuild/compilers/objc.py"}, {"content": "# Copyright 2012-2017 The Meson development team\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n#     http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport typing as T\n\nfrom .. import coredata\nfrom ..mesonlib import MachineChoice, OptionKey\n\nfrom .mixins.clike import CLikeCompiler\nfrom .compilers import Compiler\nfrom .mixins.gnu import GnuCompiler\nfrom .mixins.clang import ClangCompiler\n\nif T.TYPE_CHECKING:\n    from ..programs import ExternalProgram\n    from ..envconfig import MachineInfo\n    from ..environment import Environment\n    from ..linkers import DynamicLinker\n\nclass ObjCPPCompiler(CLikeCompiler, Compiler):\n\n    language = 'objcpp'\n\n    def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,\n                 is_cross: bool, info: 'MachineInfo',\n                 exe_wrap: T.Optional['ExternalProgram'],\n                 linker: T.Optional['DynamicLinker'] = None,\n                 full_version: T.Optional[str] = None):\n        Compiler.__init__(self, exelist, version, for_machine, info,\n                          is_cross=is_cross, full_version=full_version,\n                          linker=linker)\n        CLikeCompiler.__init__(self, exe_wrap)\n\n    @staticmethod\n    def get_display_language() -> str:\n        return 'Objective-C++'\n\n    def sanity_check(self, work_dir: str, environment: 'Environment') -> None:\n        code = '#import<stdio.h>\\nclass MyClass;int main(void) { return 0; }\\n'\n        return self._sanity_check_impl(work_dir, environment, 'sanitycheckobjcpp.mm', code)\n\n\nclass GnuObjCPPCompiler(GnuCompiler, ObjCPPCompiler):\n    def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,\n                 is_cross: bool, info: 'MachineInfo',\n                 exe_wrapper: T.Optional['ExternalProgram'] = None,\n                 defines: T.Optional[T.Dict[str, str]] = None,\n                 linker: T.Optional['DynamicLinker'] = None,\n                 full_version: T.Optional[str] = None):\n        ObjCPPCompiler.__init__(self, exelist, version, for_machine, is_cross,\n                              info, exe_wrapper, linker=linker, full_version=full_version)\n        GnuCompiler.__init__(self, defines)\n        default_warn_args = ['-Wall', '-Winvalid-pch', '-Wnon-virtual-dtor']\n        self.warn_args = {'0': [],\n                          '1': default_warn_args,\n                          '2': default_warn_args + ['-Wextra'],\n                          '3': default_warn_args + ['-Wextra', '-Wpedantic']}\n\n\nclass ClangObjCPPCompiler(ClangCompiler, ObjCPPCompiler):\n\n    def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice,\n                 is_cross: bool, info: 'MachineInfo',\n                 exe_wrapper: T.Optional['ExternalProgram'] = None,\n                 defines: T.Optional[T.Dict[str, str]] = None,\n                 linker: T.Optional['DynamicLinker'] = None,\n                 full_version: T.Optional[str] = None):\n        ObjCPPCompiler.__init__(self, exelist, version, for_machine, is_cross,\n                              info, exe_wrapper, linker=linker, full_version=full_version)\n        ClangCompiler.__init__(self, defines)\n        default_warn_args = ['-Wall', '-Winvalid-pch', '-Wnon-virtual-dtor']\n        self.warn_args = {'0': [],\n                          '1': default_warn_args,\n                          '2': default_warn_args + ['-Wextra'],\n                          '3': default_warn_args + ['-Wextra', '-Wpedantic']}\n\n\n    def get_options(self) -> 'coredata.KeyedOptionDictType':\n        opts = super().get_options()\n        opts.update({\n            OptionKey('std', machine=self.for_machine, lang='cpp'): coredata.UserComboOption(\n                'C++ language standard to use',\n                ['none', 'c++98', 'c++11', 'c++14', 'c++17', 'gnu++98', 'gnu++11', 'gnu++14', 'gnu++17'],\n                'none',\n            )\n        })\n        return opts\n\n    def get_option_compile_args(self, options: 'coredata.KeyedOptionDictType') -> T.List[str]:\n        args = []\n        std = options[OptionKey('std', machine=self.for_machine, lang='cpp')]\n        if std.value != 'none':\n            args.append('-std=' + std.value)\n        return args\n\n\nclass AppleClangObjCPPCompiler(ClangObjCPPCompiler):\n\n    \"\"\"Handle the differences between Apple's clang and vanilla clang.\"\"\"\n", "path": "mesonbuild/compilers/objcpp.py"}]}