Fix OpenMP on MacOS#126
Conversation
Tested on Github Action macos-12, macos-13 (x64) and macos-14 (arm64) runners, they aren't able to find OpenMP. I don't know why the setting of `CMAKE_PREFIX_PATH` is not enough, but it does not work as intended. This change reinstates the code from the old cryptopp-cmake project, and I confirmed this works.
|
ok this is weird, the macos CI jobs here fail and say they can't find OpenMP. However, my change is written in a way that it shouldn't be able to make things worse. Previously, there was just a |
abdes
left a comment
There was a problem hiding this comment.
Is there a way you could put all of the related things to OpenMP in a separate CMake module that we call with a single line of code? A custom FindOpenMP.cmake
|
Was there a point when this worked in the past, or did it never work and we just didn't notice? I'm sure if this never worked, there is something to fix in the find_openmp module. |
|
It worked in the legacy cmake repository, and that's actually where I got the working cmake code from, but it probably never worked here. It probably does work on other platforms, only macos seems to have this issue. For putting this into a separate cmake module, how would that work? I can for sure put it into a separate cmake file and include that. But if you want it to be included with find_package, how do I make sure it uses the in-repository FindOpenMP and not the system one? |
Tested on Github Action macos-12, macos-13 (x64) and macos-14 (arm64) runners, they aren't able to find OpenMP. I don't know why the setting of
CMAKE_PREFIX_PATHis not enough, but it does not work as intended. This change reinstates the code from the old cryptopp-cmake project, and this works correctly in all of the Github Action macos runners.This change is needed for cryfs to upgrade from the previous cryptopp-cmake scripts to the this modern-cmake one.