summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Arroz <750683+arroz@users.noreply.github.com>2022-01-09 11:59:16 -0800
committerMiguel Arroz <750683+arroz@users.noreply.github.com>2022-01-09 11:59:16 -0800
commitbe320340edaaf6e065bd3b7de2791e2c01b222c4 (patch)
tree6957463dda3da93bef8adba41962fee611a6ea07
parent7c9f77b43a82ae62664f7b5fa76aee130d8e9752 (diff)
downloadlibgit2-be320340edaaf6e065bd3b7de2791e2c01b222c4.tar.gz
Introduced `LINK_WITH_STATIC_LIBRARIES` per PR comments.
-rw-r--r--README.md2
-rw-r--r--cmake/DefaultCFlags.cmake2
2 files changed, 3 insertions, 1 deletions
diff --git a/README.md b/README.md
index 66f98e2ee..1074cd9a8 100644
--- a/README.md
+++ b/README.md
@@ -301,6 +301,8 @@ compiler and linker. These flags are rarely used but can be useful for
- `CMAKE_FIND_ROOT_PATH`: Override the search path for libraries
- `ZLIB_LIBRARY`, `OPENSSL_SSL_LIBRARY` AND `OPENSSL_CRYPTO_LIBRARY`:
Tell CMake where to find those specific libraries
+- `LINK_WITH_STATIC_LIBRARIES`: Link only with static versions of
+system libraries
MacOS X
-------
diff --git a/cmake/DefaultCFlags.cmake b/cmake/DefaultCFlags.cmake
index ad3db0980..a9c9ab972 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 APPLE AND NOT BUILD_SHARED_LIBS)
+ if(NOT BUILD_SHARED_LIBS AND LINK_WITH_STATIC_LIBRARIES)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
endif()