diff options
| author | Dylan Baker <dylan@pnwbakers.com> | 2025-07-03 15:38:32 -0700 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2025-10-06 09:03:07 -0700 |
| commit | 806289a5d27958a084bc6cba41b7cf9ccee4ecf4 (patch) | |
| tree | d6193d9aa67a6fb26e539d8b936f58aea19f2958 /mesonbuild/compilers/objcpp.py | |
| parent | be50d0e23737dc0fc5f074a291644d7fde39ef7b (diff) | |
| download | meson-806289a5d27958a084bc6cba41b7cf9ccee4ecf4.tar.gz | |
compilers: refactor sanity checking code
The goal is to reduce code duplication, and allow each language to
implement as little as possible to get good checking. The main
motivation is that half of the checks are fragile, as they add the work
directory to the paths of the generated files they want to use. This
works when run inside mesonmain because we always have an absolute build
directory, but when put into run_project_tests.py it doesn't work
because that gives a relative build directory.
Diffstat (limited to 'mesonbuild/compilers/objcpp.py')
| -rw-r--r-- | mesonbuild/compilers/objcpp.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/mesonbuild/compilers/objcpp.py b/mesonbuild/compilers/objcpp.py index 441428b2f..e59d32708 100644 --- a/mesonbuild/compilers/objcpp.py +++ b/mesonbuild/compilers/objcpp.py @@ -50,9 +50,8 @@ class ObjCPPCompiler(CLikeCompiler, Compiler): def get_display_language() -> str: return 'Objective-C++' - def sanity_check(self, work_dir: str, environment: 'Environment') -> None: - code = '#import<stdio.h>\nclass MyClass;int main(void) { return 0; }\n' - return self._sanity_check_impl(work_dir, environment, 'sanitycheckobjcpp.mm', code) + def _sanity_check_source_code(self) -> str: + return '#import<stdio.h>\nclass MyClass;int main(void) { return 0; }\n' def get_options(self) -> MutableKeyedOptionDictType: opts = super().get_options() |
