From c2c8b41e0d7e494437d1cc35ee90a1291a959225 Mon Sep 17 00:00:00 2001 From: Jun Liu Date: Mon, 25 Sep 2023 23:15:09 -0700 Subject: [PATCH] Revert "cmake: enable finding installed ZStd library (#2362)" This reverts commit e608b4325646afeabb5e52846997b926d2019d19. --- cmake/Findzstd.cmake | 91 -------------------------------------------- src/CMakeLists.txt | 5 --- 2 files changed, 96 deletions(-) delete mode 100644 cmake/Findzstd.cmake diff --git a/cmake/Findzstd.cmake b/cmake/Findzstd.cmake deleted file mode 100644 index 43ea6f9b40..0000000000 --- a/cmake/Findzstd.cmake +++ /dev/null @@ -1,91 +0,0 @@ -################################################################################ -# -# MIT License -# -# Copyright (c) 2023 Advanced Micro Devices, Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# -################################################################################ - -# Try to find the zstd library -# -# If successful, the following variables will be defined: -# zstd_INCLUDE_DIR -# zstd_LIBRARY -# zstd_STATIC_LIBRARY -# zstd_FOUND -# -# Additionally, one of the following import targets will be defined: -# zstd::libzstd_shared -# zstd::libzstd_static - -if(MSVC) - set(zstd_STATIC_LIBRARY_SUFFIX "_static\\${CMAKE_STATIC_LIBRARY_SUFFIX}$") -else() - set(zstd_STATIC_LIBRARY_SUFFIX "\\${CMAKE_STATIC_LIBRARY_SUFFIX}$") -endif() - -find_path(zstd_INCLUDE_DIR NAMES zstd.h) -find_library(zstd_LIBRARY NAMES zstd zstd_static) -find_library(zstd_STATIC_LIBRARY NAMES - zstd_static - "${CMAKE_STATIC_LIBRARY_PREFIX}zstd${CMAKE_STATIC_LIBRARY_SUFFIX}") - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args( - zstd DEFAULT_MSG - zstd_LIBRARY zstd_INCLUDE_DIR -) - -if(zstd_FOUND) - if(zstd_LIBRARY MATCHES "${zstd_STATIC_LIBRARY_SUFFIX}$") - set(zstd_STATIC_LIBRARY "${zstd_LIBRARY}") - elseif (NOT TARGET zstd::libzstd_shared) - add_library(zstd::libzstd_shared SHARED IMPORTED) - if(MSVC) - # IMPORTED_LOCATION is the path to the DLL and IMPORTED_IMPLIB is the "library". - get_filename_component(zstd_DIRNAME "${zstd_LIBRARY}" DIRECTORY) - string(REGEX REPLACE "${CMAKE_INSTALL_LIBDIR}$" "${CMAKE_INSTALL_BINDIR}" zstd_DIRNAME "${zstd_DIRNAME}") - get_filename_component(zstd_BASENAME "${zstd_LIBRARY}" NAME) - string(REGEX REPLACE "\\${CMAKE_LINK_LIBRARY_SUFFIX}$" "${CMAKE_SHARED_LIBRARY_SUFFIX}" zstd_BASENAME "${zstd_BASENAME}") - set_target_properties(zstd::libzstd_shared PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${zstd_INCLUDE_DIR}" - IMPORTED_LOCATION "${zstd_DIRNAME}/${zstd_BASENAME}" - IMPORTED_IMPLIB "${zstd_LIBRARY}") - unset(zstd_DIRNAME) - unset(zstd_BASENAME) - else() - set_target_properties(zstd::libzstd_shared PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${zstd_INCLUDE_DIR}" - IMPORTED_LOCATION "${zstd_LIBRARY}") - endif() - endif() - if(zstd_STATIC_LIBRARY MATCHES "${zstd_STATIC_LIBRARY_SUFFIX}$" AND - NOT TARGET zstd::libzstd_static) - add_library(zstd::libzstd_static STATIC IMPORTED) - set_target_properties(zstd::libzstd_static PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${zstd_INCLUDE_DIR}" - IMPORTED_LOCATION "${zstd_STATIC_LIBRARY}") - endif() -endif() - -unset(zstd_STATIC_LIBRARY_SUFFIX) - -mark_as_advanced(zstd_INCLUDE_DIR zstd_LIBRARY zstd_STATIC_LIBRARY) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 95da2f345d..cd666a8e26 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -672,11 +672,6 @@ rocm_set_soversion(MIOpen ${MIOpen_SOVERSION}) clang_tidy_check(MIOpen) -find_package(zstd) -if(zstd_FOUND) - target_link_libraries(MIOpen PRIVATE zstd::libzstd_static) -endif() - function(target_internal_library TARGET) target_link_libraries(${TARGET} PRIVATE ${ARGN}) set(PASS_ARGS debug optimized)