def build_incdir_object(self, incdir_strings: T.List[str], is_system: bool=False) -> build.IncludeDirs:
    if (not isinstance(is_system, bool)):
        raise InvalidArguments('Is_system must be boolean.')
    src_root = self.environment.get_source_dir()
    build_root = self.environment.get_build_dir()
    absbase_src = os.path.join(src_root, self.subdir)
    absbase_build = os.path.join(build_root, self.subdir)
    for a in incdir_strings:
        if a.startswith(src_root):
            raise InvalidArguments(textwrap.dedent("                    Tried to form an absolute path to a source dir.\n                    You should not do that but use relative paths instead.\n\n                    To get include path to any directory relative to the current dir do\n\n                    incdir = include_directories(dirname)\n\n                    After this incdir will contain both the current source dir as well as the\n                    corresponding build dir. It can then be used in any subdirectory and\n                    Meson will take care of all the busywork to make paths work.\n\n                    Dirname can even be '.' to mark the current directory. Though you should\n                    remember that the current source and build directories are always\n                    put in the include directories by default so you only need to do\n                    include_directories('.') if you intend to use the result in a\n                    different subdirectory.\n                    "))
        else:
            try:
                self.validate_within_subproject(self.subdir, a)
            except InterpreterException:
                mlog.warning('include_directories sandbox violation!', location=self.current_node)
                print(textwrap.dedent(f'''                        The project is trying to access the directory {a!r} which belongs to a different
                        subproject. This is a problem as it hardcodes the relative paths of these two projects.
                        This makes it impossible to compile the project in any other directory layout and also
                        prevents the subproject from changing its own directory layout.

                        Instead of poking directly at the internals the subproject should be executed and
                        it should set a variable that the caller can then use. Something like:

                        # In subproject
                        some_dep = declare_dependency(include_directories: include_directories('include'))

                        # In subproject wrap file
                        [provide]
                        some = some_dep

                        # In parent project
                        some_dep = dependency('some')
                        executable(..., dependencies: [some_dep])

                        This warning will become a hard error in a future Meson release.
                        '''))
        absdir_src = os.path.join(absbase_src, a)
        absdir_build = os.path.join(absbase_build, a)
        if ((not os.path.isdir(absdir_src)) and (not os.path.isdir(absdir_build))):
            raise InvalidArguments(f'Include dir {a} does not exist.')
    i = build.IncludeDirs(self.subdir, incdir_strings, is_system)
    return i
def build_incdir_object(self, incdir_strings: T.List[str], is_system: bool=False) -> build.IncludeDirs:
    if (not isinstance(is_system, bool)):
        raise InvalidArguments('Is_system must be boolean.')
    src_root = self.environment.get_source_dir()
    build_root = self.environment.get_build_dir()
    absbase_src = os.path.join(src_root, self.subdir)
    absbase_build = os.path.join(build_root, self.subdir)
    for a in incdir_strings:
        if a.startswith(src_root):
            raise InvalidArguments(textwrap.dedent("                    Tried to form an absolute path to a source dir.\n                    You should not do that but use relative paths instead.\n\n                    To get include path to any directory relative to the current dir do\n\n                    incdir = include_directories(dirname)\n\n                    After this incdir will contain both the current source dir as well as the\n                    corresponding build dir. It can then be used in any subdirectory and\n                    Meson will take care of all the busywork to make paths work.\n\n                    Dirname can even be '.' to mark the current directory. Though you should\n                    remember that the current source and build directories are always\n                    put in the include directories by default so you only need to do\n                    include_directories('.') if you intend to use the result in a\n                    different subdirectory.\n                    "))
        else:
            try:
                self.validate_within_subproject(self.subdir, a)
            except InterpreterException:
                mlog.warning('include_directories sandbox violation!', location=self.current_node)
                print(textwrap.dedent(f'                        The project is trying to access the directory {a!r} which belongs to a different
                        subproject. This is a problem as it hardcodes the relative paths of these two projects.
                        This makes it impossible to compile the project in any other directory layout and also
                        prevents the subproject from changing its own directory layout.

                        Instead of poking directly at the internals the subproject should be executed and
                        it should set a variable that the caller can then use. Something like:

                        # In subproject
                        some_dep = declare_dependency(include_directories: include_directories('include'))

                        # In subproject wrap file
                        [provide]
                        some = some_dep

                        # In parent project
                        some_dep = dependency('some')
                        executable(..., dependencies: [some_dep])

                        This warning will become a hard error in a future Meson release.
                        '))
        absdir_src = os.path.join(absbase_src, a)
        absdir_build = os.path.join(absbase_build, a)
        if ((not os.path.isdir(absdir_src)) and (not os.path.isdir(absdir_build))):
            raise InvalidArguments(f'Include dir {a} does not exist.')
    i = build.IncludeDirs(self.subdir, incdir_strings, is_system)
    return i