Skip to content

Commit eed7166

Browse files
committed
[cmake] Include GNUInstallDirs before using variables defined by it.
This fixes an odd problem with the regex when `CMAKE_INSTALL_LIBDIR` is not defined: `string sub-command REGEX, mode REPLACE: regex "$" matched an empty string.` Fixes #83802
1 parent e040474 commit eed7166

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

llvm/cmake/modules/Findzstd.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ if(zstd_FOUND)
3434
elseif (NOT TARGET zstd::libzstd_shared)
3535
add_library(zstd::libzstd_shared SHARED IMPORTED)
3636
if(MSVC)
37+
include(GNUInstallDirs) # For CMAKE_INSTALL_LIBDIR and friends.
3738
# IMPORTED_LOCATION is the path to the DLL and IMPORTED_IMPLIB is the "library".
3839
get_filename_component(zstd_DIRNAME "${zstd_LIBRARY}" DIRECTORY)
3940
string(REGEX REPLACE "${CMAKE_INSTALL_LIBDIR}$" "${CMAKE_INSTALL_BINDIR}" zstd_DIRNAME "${zstd_DIRNAME}")

0 commit comments

Comments
 (0)