PositionBasedDynamics
PositionBasedDynamics copied to clipboard
macOS compatibility (v1, for SPlisHSPlasH)
These adaptations allow builds using Clang on recent versions of macOS (tested on Apple silicon):
- An updated and adapted version of Discregrid is used (see Discregrid#19). If the pull requests are accepted,
CMakeLists.txthas to be updated to point to the original repository again. - Clang seems to mistake some version files for headers, so these are given an extension.
- The optimization flag
-mcpu=apple-m1is used for Apple silicon, for which-march=nativeis not yet supported. - OpenGL is deprecated for years on macOS, but still supported, so the corresponding warnings are silenced.
_NSGetExecutablePathis used to find program paths on macOS.- Recent versions of CMake automatically determine the correct flags for OpenMP and provide a target to link against. Nevertheless, Clang does not include an OpenMP implementation on macOS by default, but the user can easily install a build of LLVM libomp (e.g. via Homebrew) to be shared by all projects requiring OpenMP which is then detected by CMake.
The changes are similar to those in #123, but based on the version of commit 67cea44, which is used and wrapped in SPlisHSPlasH. For this purpose, they could be pulled into a new branch.
With commit 12bef59 updating the PBD version of SPlisHSPlasH to v2, this pull request becomes obsolete and is superseded by #123.