apple / swift-numerics

Advanced mathematical types and functions for Swift

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add a script to generate the CMakeLists files?

benrimmington opened this issue · comments

The current CMake build of swift-numerics¹ has a CMakeLists.txt file for each target;
and a single Tests/WindowsMain.swift file to run the tests.

Could the contents of these files be generated by a script?


For the CMakeLists.txt files, there's a SwiftPM subcommand which provides most (or all?) of the required information:

swift package describe --type json

Could a single top-level CMakeLists.txt file be used instead?
Then the package manifest wouldn't need to exclude: ["CMakeLists.txt"] for each target.


For the Tests/WindowsMain.swift file, there are at least two options:

swift test --generate-linuxmain

swift test --list-tests

The first (deprecated) option generates Tests/LinuxMain.swift and Tests/*/XCTestManifests.swift files;
the second option might not provide enough information.

Could a pair of top-level CMakeLists.py and CMakeLists.swift files be used instead?


¹(also: swift-argument-parser, swift-atomics, swift-collections, swift-system, …)

This seems reasonable to me; we're still left with needing to exclude README.md, though 😢