cps-org / cps

Common Package Specification — A cross-tool mechanism for locating software dependencies
https://cps-org.github.io/cps/
Other
99 stars 8 forks source link

composing cps files (or how to handle debug builds created seperately) #10

Open dcbaker opened 3 years ago

dcbaker commented 3 years ago

Meson doesn't have (by design) a way to generate debug and optimized targets in the same build, instead we would recommend two separate builds for that (we only have out of tree builds, so this is super trivial for us).

The sample has this:

{
  "sample-shared": {
    "Type": "dylib",
    "Requires": [ ":sample-core" ],
    "Configurations": {
      "Optimized": {
        "Location": "@prefix@/lib64/libsample.so.1.2.0"
      },
      "Debug": {
        "Location": "@prefix@/lib64/libsample_d.so.1.2.0"
      }
    }
  }
}

It would be impossible for meson to generate this CPS file, however, because of that design decision. For us we would either need a standard way to compose cps files, or to drop the ability to report debug and optimized in a single cps file.

dcbaker commented 3 years ago

Reading the spec again, this seems like it should be possible, but the spec should provide more guidance on what the files should look like, Especially since the debug and not-debug files will not be aware that the other exists.

mwoehlke commented 1 year ago

CMake is basically the same way. The recommendation there, which I think applies to Meson also, would be to generate a "base" CPS file with the attributes that aren't configuration-specific, and generate additional configuration-specific files with the configuration-specific attributes.

That documentation needs to exist somewhere, and things will certainly get better as CPS gets more real-world use. For now, see Configuration Merging and these examples.