apple / swift-numerics

Advanced mathematical types and functions for Swift
Apache License 2.0
1.69k stars 147 forks source link

Issues with CMake support #284

Open dabrahams opened 8 months ago

dabrahams commented 8 months ago

~I have a suspicion that this bug may be triggered by the CMakeLists doing things they probably shouldn't, e.g. globally setting variables like CMAKE_Swift_MODULE_DIRECTORY even when it is not top-level and then using that to set INTERFACE_INCLUDE_DIRECTORIES properties. Obviously, the CMake Xcode generator “should” be resilient to any arbitrary setup you choose, but it's probably impossible for its author to avoid making some assumptions of regularity. I know what patch to offer for those top level variables, but then the INTERFACE_INCLUDE_DIRECTORIES settings stop having their intended effect.~

I'd like to know what cmake + Ninja commands are expected to work on this project so that I can propose changes that preserve that functionality.

/cc @compnerd who wrote most of the CMake support.

compnerd commented 8 months ago

I'm not sure what exactly you mean by "what cmake + Ninja commands are expected to work", could you elaborate on that? This project has been built standalone and as part of the swift project build for S4TF using the existing CMake support.

dabrahams commented 8 months ago

OK, first: I have confirmed that the reason the Xcode build isn't working is that the Xcode generator doesn't work with add_subdirectory. So it has nothing to do with this project's CMake support.

I'm not sure what exactly you mean by "what cmake + Ninja commands are expected to work", could you elaborate on that?

I mean, if I want to submit a PR to change the CMake support, what commands should I use to verify that I haven't broken anything that people currently expect to work? If I was changing Swift code, the answer would be swift test or something. I'm looking for an analog to that for changing CMake code.

This project has been built standalone and as part of the swift project build for S4TF using the existing CMake support.

I'm sure it has, but doubtless with the Xcode generator.

dabrahams commented 8 months ago

See previous comment, which has been updated.