diff options
author | Miguel Arroz <750683+arroz@users.noreply.github.com> | 2021-12-29 15:26:33 -0800 |
---|---|---|
committer | Miguel Arroz <750683+arroz@users.noreply.github.com> | 2021-12-29 15:26:33 -0800 |
commit | 3eb3981978e118dce49e40f273f37e3b2dbbbba4 (patch) | |
tree | f8ef206e79135906529984c2616219c7a5d8903e /cmake | |
parent | 50b4d53ef3897fd4066cd74734f4a6e141a64201 (diff) | |
download | libgit2-3eb3981978e118dce49e40f273f37e3b2dbbbba4.tar.gz |
Disabling setting `CMAKE_FIND_LIBRARY_SUFFIXES` on Apple platforms.
On macOS, since Big Sur, the libraries were moved to a cache. The SDK comes
with stubs in the SDK (`/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/lib/`
or whatever SDK version one has installed) where most have the `.tbd` suffix
(although some still are `.a`). Forcing `CMAKE_FIND_LIBRARY_SUFFIXES` on Apple
platforms broke building, unless one has copies of the libraries installed
elsewhere (like Brew), as many libraries (like `iconv` or `pcre`) are not
found.
This fix disables setting the `CMAKE_FIND_LIBRARY_SUFFIXES` to `.a` if
the platform is `APPLE` when building static libs.
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/DefaultCFlags.cmake | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmake/DefaultCFlags.cmake b/cmake/DefaultCFlags.cmake index fa59e1d97..ad3db0980 100644 --- a/cmake/DefaultCFlags.cmake +++ b/cmake/DefaultCFlags.cmake @@ -92,7 +92,7 @@ else() set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -D <TARGET>") endif() - if(NOT BUILD_SHARED_LIBS) + if(NOT APPLE AND NOT BUILD_SHARED_LIBS) set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") endif() |