Meta+Libraries+AK: Append Cxx to imported library module names in swift

At the same time, simplify CMakeLists magic for libraries that want to
include Swift code in the library. The Lib-less name of the library is
now always the module name for the library with any Swift additions,
extensions, etc. All vfs overlays now live in a common location to make
finding them easier from CMake functions. A new pattern is needed for
the Lib-less modules to re-export their Cxx counterparts.
This commit is contained in:
Andrew Kaster 2024-08-26 19:04:05 -06:00 committed by Andrew Kaster
parent f27d638e0a
commit c5153cb398
Notes: github-actions[bot] 2024-08-27 23:23:23 +00:00
13 changed files with 68 additions and 80 deletions

View file

@ -27,6 +27,7 @@ def main():
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument('directory', help='source directory to generate module map for')
parser.add_argument('generated_files', nargs='+', help='extra files to include in the module map')
parser.add_argument('-n', '--module-name', help='top-level module name')
parser.add_argument('-m', '--module-map', required=True, help='output module map file')
parser.add_argument('-v', '--vfs-map', required=True, help='output VFS map file')
args = parser.parse_args()
@ -36,9 +37,10 @@ def main():
print(f"Error: {args.directory} is not a directory", file=sys.stderr)
return 1
pathlib.Path(args.module_map).parent.mkdir(parents=True, exist_ok=True)
pathlib.Path(args.vfs_map).parent.mkdir(parents=True, exist_ok=True)
header_files = [f for f in root.rglob('**/*.h') if f.is_file()]
module_name = root.name
module_name = args.module_name if args.module_name else root.name
module_map = f"module {module_name} {{\n"
for header_file in header_files: