summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorDaniel Ching <carterbox@users.noreply.github.com>2023-12-07 04:47:47 (GMT)
committerDaniel Ching <carterbox@users.noreply.github.com>2023-12-08 01:19:00 (GMT)
commitf20c5c6f20aa7eab9e43919fffbf5b00281d1461 (patch)
tree33857e147a1cd011f444912010879c53d28dbe91 /Tests/RunCMake
parent7598ea5389e04862c567b43d7c08fbbc66512f37 (diff)
downloadCMake-f20c5c6f20aa7eab9e43919fffbf5b00281d1461.zip
CMake-f20c5c6f20aa7eab9e43919fffbf5b00281d1461.tar.gz
CMake-f20c5c6f20aa7eab9e43919fffbf5b00281d1461.tar.bz2
MSVC: Teach find_library to consider Rust's '${name}.dll.lib' convention
This convention is used by Rust toolchains (rustc/cargo/cargo-c) for the MSVC ABI. Fixes: #25478
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/find_library/Windows-MSVC-stdout.txt1
-rw-r--r--Tests/RunCMake/find_library/Windows-MSVC.cmake3
-rw-r--r--Tests/RunCMake/find_library/Windows-MSVC/rustc_import.dll.lib0
-rw-r--r--Tests/RunCMake/find_library/Windows-MSVC/rustc_import.lib0
4 files changed, 4 insertions, 0 deletions
diff --git a/Tests/RunCMake/find_library/Windows-MSVC-stdout.txt b/Tests/RunCMake/find_library/Windows-MSVC-stdout.txt
index af5c30b..598ede5 100644
--- a/Tests/RunCMake/find_library/Windows-MSVC-stdout.txt
+++ b/Tests/RunCMake/find_library/Windows-MSVC-stdout.txt
@@ -1 +1,2 @@
-- STATIC_LIBRARY='[^']*/Tests/RunCMake/find_library/Windows-MSVC/static.lib'
+-- RUSTC_IMPORT_LIBRARY='[^']*/Tests/RunCMake/find_library/Windows-MSVC/rustc_import.dll.lib'
diff --git a/Tests/RunCMake/find_library/Windows-MSVC.cmake b/Tests/RunCMake/find_library/Windows-MSVC.cmake
index 212f2c4..485952d 100644
--- a/Tests/RunCMake/find_library/Windows-MSVC.cmake
+++ b/Tests/RunCMake/find_library/Windows-MSVC.cmake
@@ -2,3 +2,6 @@ enable_language(C)
find_library(STATIC_LIBRARY NAMES static NO_DEFAULT_PATH PATHS ${CMAKE_CURRENT_SOURCE_DIR}/Windows-MSVC)
message(STATUS "STATIC_LIBRARY='${STATIC_LIBRARY}'")
+
+find_library(RUSTC_IMPORT_LIBRARY NAMES rustc_import NO_DEFAULT_PATH PATHS ${CMAKE_CURRENT_SOURCE_DIR}/Windows-MSVC)
+message(STATUS "RUSTC_IMPORT_LIBRARY='${RUSTC_IMPORT_LIBRARY}'")
diff --git a/Tests/RunCMake/find_library/Windows-MSVC/rustc_import.dll.lib b/Tests/RunCMake/find_library/Windows-MSVC/rustc_import.dll.lib
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/find_library/Windows-MSVC/rustc_import.dll.lib
diff --git a/Tests/RunCMake/find_library/Windows-MSVC/rustc_import.lib b/Tests/RunCMake/find_library/Windows-MSVC/rustc_import.lib
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/find_library/Windows-MSVC/rustc_import.lib