Skip to content

Commit 5bbd598

Browse files
authored
[cmake] Include GNUInstallDirs before using variables defined by it. (llvm#83807)
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 llvm#83802
1 parent 5506831 commit 5bbd598

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
if(NOT "${CMAKE_INSTALL_LIBDIR}" STREQUAL "" AND NOT "${CMAKE_INSTALL_BINDIR}" STREQUAL "")

0 commit comments

Comments
 (0)