summaryrefslogtreecommitdiff
path: root/Modules/Platform
diff options
context:
space:
mode:
authorYonggang Luo <luoyonggang@gmail.com>2022-09-19 18:12:22 +0800
committerBrad King <brad.king@kitware.com>2022-09-19 11:02:44 -0400
commitbe848a71b079cbb21b2b6f9bdbf5d2fff8f46426 (patch)
tree9f1653a867fd253c5ef5edf385e7ba29185e90c1 /Modules/Platform
parent40af69a1069abfff1e3bd63683ac55d4943f24bd (diff)
downloadcmake-be848a71b079cbb21b2b6f9bdbf5d2fff8f46426.tar.gz
MSVC: Teach find_library to consider the 'libfoo.a' naming convention
When targeting the GNU ABI, we consider `.a` libraries first but also accept `.lib`. For symmetry, when targeting the MSVC ABI, we now consider `.lib` first but also accept `.a`. This adds support for meson-generated static libraries, which are named with the pattern `lib${foo}.a`: * https://mesonbuild.com/FAQ.html#why-does-building-my-project-with-msvc-output-static-libraries-called-libfooa Fixes: #23975 Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Diffstat (limited to 'Modules/Platform')
-rw-r--r--Modules/Platform/Windows.cmake4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/Platform/Windows.cmake b/Modules/Platform/Windows.cmake
index d8b3957818..5263161155 100644
--- a/Modules/Platform/Windows.cmake
+++ b/Modules/Platform/Windows.cmake
@@ -19,8 +19,8 @@ set(CMAKE_LINK_LIBRARY_SUFFIX ".lib")
set(CMAKE_DL_LIBS "")
set(CMAKE_EXTRA_LINK_EXTENSIONS ".targets")
-set(CMAKE_FIND_LIBRARY_PREFIXES "")
-set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
+set(CMAKE_FIND_LIBRARY_PREFIXES "" "lib")
+set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".a")
# for borland make long command lines are redirected to a file
# with the following syntax, see Windows-bcc32.cmake for use