cmake: Move runtime output artifacts to ${PROJECT_BINARY_DIR} #1233

pull hebasto wants to merge 2 commits into bitcoin-core:master from hebasto:230310-output changing 4 files +11 −11
  1. hebasto commented at 2:00 am on March 10, 2023: member

    From IRC:

    12:32 < sipa> With cmake, the build artefacts seem to end up in build/src/, while I’d expect them in build/.

    Implemented in this PR.

    On Windows, this also simplifies running examples, because the DLL must resides either in the same folder where the executable is or somewhere in PATH.

  2. hebasto force-pushed on Mar 10, 2023
  3. real-or-random commented at 9:13 am on March 10, 2023: contributor

    Hm, I don’t know. This seems a bit arbitrary.

    If we now deviate from putting the artifacts in their respective source directory anyway, and setting the artifact path is just setting a variable, would it make sense to also just put anything in ${PROJECT_BINARY_DIR} (or in a dedicated subdir of that)?

  4. hebasto commented at 9:49 am on March 10, 2023: member

    Hm, I don’t know. This seems a bit arbitrary.

    Agree. But adding each path for every configuration to PATH, which is the case for multi-config, is really annoying.

    If we now deviate from putting the artifacts in their respective source directory anyway, and setting the artifact path is just setting a variable, would it make sense to also just put anything in ${PROJECT_BINARY_DIR} (or in a dedicated subdir of that)?

    Like ${PROJECT_BINARY_DIR}/out? Or ${PROJECT_BINARY_DIR}/bin?

  5. real-or-random commented at 10:09 am on March 10, 2023: contributor

    Agree. But adding each path for every configuration to PATH, which is the case for multi-config, is really annoying.

    Indeed. It’s also annoying for devs on Windows (though noone uses Windows right now…)

    Like ${PROJECT_BINARY_DIR}/out? Or ${PROJECT_BINARY_DIR}/bin?

    Yeah, I had something like this in mind. out is probably a bit nicer because bin looks wrong for .so etc. Just not convinced it’s worth it. Having a subdir is a cheap and feels tiny bit cleaner because it avoids name collisions with existing files (e.g., what if we have a binary examples). Though in that case, autotools would break anyway… I guess there’s no clear right or wrong here, but if we want to move all artifacts to a single location, then ${PROJECT_BINARY_DIR} is probably good enough, and then it matches the autotools behavior at least. As discussed in IRC, we don’t care much and should do whatever makes things easier.

  6. cmake: Move runtime output artifacts to `${PROJECT_BINARY_DIR}`
    This change (1) simplifies running examples on Windows, because the DLL
    must resides either in the same folder where the executable is or
    somewhere in PATH; and (2) mimics Autotools-based build system behavior.
    46ecb3663c
  7. ci: Drop no longer needed code 9dae69259b
  8. hebasto force-pushed on Mar 10, 2023
  9. hebasto renamed this:
    cmake: Move example binaries to `${PROJECT_BINARY_DIR}/src`
    cmake: Move runtime output artifacts to `${PROJECT_BINARY_DIR}`
    on Mar 10, 2023
  10. hebasto commented at 6:27 pm on March 10, 2023: member

    … if we want to move all artifacts to a single location, then ${PROJECT_BINARY_DIR} is probably good enough, and then it matches the autotools behavior at least.

    Done.

    The PR description has been updated (friendly ping @sipa :D ).

  11. hebasto marked this as a draft on Apr 12, 2023
  12. hebasto commented at 11:16 am on April 12, 2023: member
    Converted to draft for now.
  13. theuni commented at 2:37 pm on April 27, 2023: contributor
    Rather than setting the PATH in CI, can we set it in CMake for make check?
  14. real-or-random commented at 2:38 pm on April 27, 2023: contributor

    Rather than setting the PATH in CI, can we set it in CMake for make check?

    I think this makes sense, and then Concept NACK on moving the binaries

  15. hebasto cross-referenced this on Apr 29, 2023 from issue cmake: Set `ENVIRONMENT` property for examples on Windows by hebasto
  16. hebasto commented at 9:29 am on April 29, 2023: member

    @theuni @real-or-random

    Rather than setting the PATH in CI, can we set it in CMake for make check?

    Implemented in #1290.

    Closing in favour of #1290.

  17. hebasto closed this on Apr 29, 2023

  18. hebasto deleted the branch on Apr 29, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-18 01:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me