cmake: Move runtime output artifacts to ${PROJECT_BINARY_DIR}#1233
cmake: Move runtime output artifacts to ${PROJECT_BINARY_DIR}#1233hebasto wants to merge 2 commits intobitcoin-core:masterfrom
${PROJECT_BINARY_DIR}#1233Conversation
real-or-random
left a comment
There was a problem hiding this comment.
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)?
Agree. But adding each path for every configuration to
Like |
Indeed. It's also annoying for devs on Windows (though noone uses Windows right now...)
Yeah, I had something like this in mind. |
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.
${PROJECT_BINARY_DIR}/src${PROJECT_BINARY_DIR}
Done. The PR description has been updated (friendly ping @sipa :D ). |
|
Converted to draft for now. |
|
Rather than setting the PATH in CI, can we set it in CMake for |
I think this makes sense, and then Concept NACK on moving the binaries |
175db31 ci: Drop no longer needed `PATH` variable update on Windows (Hennadii Stepanov) 116d2ab cmake: Set `ENVIRONMENT` property for examples on Windows (Hennadii Stepanov) cef3739 cmake, refactor: Use helper function instead of interface library (Hennadii Stepanov) Pull request description: This PR simplifies running examples on Windows, because the DLL must reside either in the same folder where the executable is or somewhere in PATH. It is an alternative to #1233. ACKs for top commit: real-or-random: utACK 175db31 Tree-SHA512: 8188018589a5bcf0179647a039cdafcce661dc103a70a5bb9e6b6f680b899332ba30b1e9ef5dad2a8c22c315d7794747e49d8cf2e391eebea21e3d8505ee334b
c232486 Revert "cmake: Set `ENVIRONMENT` property for examples on Windows" (Hennadii Stepanov) 26e4a7c cmake: Set top-level target output locations (Hennadii Stepanov) Pull request description: While testing #1551, I noticed that when cross-compiling a shared library with examples for Windows, the `ctest` fails to run examples with Wine. Adjusting the `PATH` variable in https://github.com/bitcoin-core/secp256k1/blob/4af241b32099067464e015fa66daac5096206dea/examples/CMakeLists.txt#L16-L18 does not help because `WINEPATH` is expected. Another issue with the current implementation is that the examples cannot run individually on Windows. This PR resolves both issues by reverting the implementation from #1290 in favour of the reworked and improved implementation from #1233. ACKs for top commit: theuni: Concept ACK and utACK c232486. real-or-random: utACK c232486 Tree-SHA512: 479b71d15d5d5670f6f69da3da599240c345711003383ca805c821b67065c9baaf269f987792cf1029211cdbfe799aecd401e6940a471539e3929b4a90e0781d
From IRC:
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.