Skip to content

Commit 56e8e04

Browse files
authored andcommitted
[cmake] Include GNUInstallDirs before using variables defined by it. (#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 #83802 (cherry picked from commit 5bbd598)
1 parent 3bf9b25 commit 56e8e04

File tree

Image for: File tree

1 file changed

Image for: 1 file changed
+1
-0
lines changed

1 file changed

Image for: 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

Image for: 0 commit comments
Comments
 (0)