未验证 提交 e42ed7d1 编写于 作者: S sneaxiy 提交者: GitHub

fix compile dir conflict with include_dirs (#38479)

上级 dc30ad1d
...@@ -471,16 +471,17 @@ def normalize_extension_kwargs(kwargs, use_cuda=False): ...@@ -471,16 +471,17 @@ def normalize_extension_kwargs(kwargs, use_cuda=False):
Normalize include_dirs, library_dir and other attributes in kwargs. Normalize include_dirs, library_dir and other attributes in kwargs.
""" """
assert isinstance(kwargs, dict) assert isinstance(kwargs, dict)
include_dirs = [] compile_include_dirs = []
# NOTE: the "_compile_dir" argument is not public to users. It is only # NOTE: the "_compile_dir" argument is not public to users. It is only
# reserved for internal usage. We do not guarantee that this argument # reserved for internal usage. We do not guarantee that this argument
# is always valid in the future release versions. # is always valid in the future release versions.
compile_dir = kwargs.get("_compile_dir", None) compile_dir = kwargs.get("_compile_dir", None)
if compile_dir: if compile_dir:
include_dirs = _get_include_dirs_when_compiling(compile_dir) compile_include_dirs = _get_include_dirs_when_compiling(compile_dir)
# append necessary include dir path of paddle # append necessary include dir path of paddle
include_dirs = kwargs.get('include_dirs', include_dirs) include_dirs = list(kwargs.get('include_dirs', []))
include_dirs.extend(compile_include_dirs)
include_dirs.extend(find_paddle_includes(use_cuda)) include_dirs.extend(find_paddle_includes(use_cuda))
kwargs['include_dirs'] = include_dirs kwargs['include_dirs'] = include_dirs
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册