Conversation
For reference: microsoft/vcpkg#44940
|
This complements flac/src/libFLAC/CMakeLists.txt Lines 111 to 113 in 8d64845 |
|
Related issue: #820 |
|
I'm not fluent in CMake, so please help me out here. This dependency is added when the ENABLE_MULTITHREADING input is ON, but would using the output variable HAVE_PTHREAD be better? This is suggested in #820 |
|
If your library links So this is what this PR does. Canonical, minimal CMake, mirroring CMakeLists.txt. #820 is different:
|
|
BTW this change is applied in the vcpkg port. |
|
Would that mean that the wrong variable is used in the lines you quoted last time? flac/src/libFLAC/CMakeLists.txt Lines 111 to 113 in 8d64845 Also, I'm wondering what would happen if find_package(Threads) doesn't find any multithreading capability. Then the build would not require a lib, but the file would say it does. Maybe we shouldn't check for HAVE_PTHREAD or ENABLE_MULTITHREADING, but instead for Threads_FOUND? Finally, and I understand this is not something FLAC-specific, how does this work if configuration during build finds one library (for example pthread), and configuration with that flac-config.cmake file finds another multithreading capability. Would that even be possible? |
I deliberately said "different", not "wrong". The full context needs to see Lines 225 to 236 in afb801b So, HAVE_PTHREAD might indeed be more suitable to mirror the actual wiring in the CMakeLists.txt files. (The option "ENABLE_MULTITHREADING" is not directly wired to the use of Threads::Threads, and it may not even enable multithreading.)
|
For reference: microsoft/vcpkg#44940