forked from mesonbuild/meson
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cython: wire up support for emitting and using depfiles
This solves rebuild issues when e.g. importing a .pxd header from a .pyx file, just like C/C++ source headers. The transpiler needs to run again in this case. This functionality is present in the 3.0.0 alphas of cython, and is also available in an unreleased maintenance branch of 0.29 -- see cython/cython#5158
- Loading branch information
1 parent
f6f3090
commit c5a764d
Showing
2 changed files
with
17 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
import typing as T | ||
|
||
from .. import coredata | ||
from ..mesonlib import EnvironmentException, OptionKey | ||
from ..mesonlib import EnvironmentException, OptionKey, version_compare | ||
from .compilers import Compiler | ||
|
||
if T.TYPE_CHECKING: | ||
|
@@ -39,6 +39,14 @@ def get_optimization_args(self, optimization_level: str) -> T.List[str]: | |
# compiler might though | ||
return [] | ||
|
||
def get_dependency_gen_args(self, outtarget: str, outfile: str) -> T.List[str]: | ||
if version_compare(self.version, '>=3.0.0'): | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
eli-schwartz
Author
Owner
|
||
return ['-M'] | ||
return [] | ||
|
||
def get_depfile_suffix(self) -> str: | ||
return 'dep' | ||
|
||
def sanity_check(self, work_dir: str, environment: 'Environment') -> None: | ||
code = 'print("hello world")' | ||
with self.cached_compile(code, environment.coredata) as p: | ||
|
depfile support has been releases in Cython 0.29.33, see cython/cython#5158. It would be nice to have this patch land in Meson!