swift-numerics icon indicating copy to clipboard operation
swift-numerics copied to clipboard

Add a script to generate the CMakeLists files?

Open benrimmington opened this issue 4 years ago • 1 comments
trafficstars

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, …)

benrimmington avatar Sep 02 '21 19:09 benrimmington

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

stephentyrone avatar Sep 10 '21 01:09 stephentyrone