[PATCH] D99451: Use write_basic_package_version_file for LLVM
Stephen Kelly via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 27 14:03:20 PDT 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rG3001d080c813: [CMake] Use write_basic_package_version_file for LLVM (authored by alexreinking, committed by stephenkelly).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D99451/new/
https://reviews.llvm.org/D99451
Files:
llvm/cmake/modules/CMakeLists.txt
llvm/cmake/modules/LLVMConfigVersion.cmake.in
Index: llvm/cmake/modules/LLVMConfigVersion.cmake.in
===================================================================
--- llvm/cmake/modules/LLVMConfigVersion.cmake.in
+++ /dev/null
@@ -1,13 +0,0 @@
-set(PACKAGE_VERSION "@PACKAGE_VERSION@")
-
-# LLVM is API-compatible only with matching major.minor versions
-# and patch versions not less than that requested.
-if("@LLVM_VERSION_MAJOR at .@LLVM_VERSION_MINOR@" VERSION_EQUAL
- "${PACKAGE_FIND_VERSION_MAJOR}.${PACKAGE_FIND_VERSION_MINOR}"
- AND NOT "@LLVM_VERSION_PATCH@" VERSION_LESS "${PACKAGE_FIND_VERSION_PATCH}")
- set(PACKAGE_VERSION_COMPATIBLE 1)
- if("@LLVM_VERSION_PATCH@" VERSION_EQUAL
- "${PACKAGE_FIND_VERSION_PATCH}")
- set(PACKAGE_VERSION_EXACT 1)
- endif()
-endif()
Index: llvm/cmake/modules/CMakeLists.txt
===================================================================
--- llvm/cmake/modules/CMakeLists.txt
+++ llvm/cmake/modules/CMakeLists.txt
@@ -127,11 +127,13 @@
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/LLVMConfig.cmake
@ONLY)
-# Generate LLVMConfigVersion.cmake for build and install tree.
-configure_file(
- LLVMConfigVersion.cmake.in
- ${llvm_cmake_builddir}/LLVMConfigVersion.cmake
- @ONLY)
+# Generate LLVMConfigVersion.cmake for build tree (later copied to install tree).
+include(CMakePackageConfigHelpers)
+write_basic_package_version_file(
+ "${llvm_cmake_builddir}/LLVMConfigVersion.cmake"
+ VERSION "${PACKAGE_VERSION}"
+ COMPATIBILITY SameMinorVersion
+)
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
get_property(llvm_has_exports GLOBAL PROPERTY LLVM_HAS_EXPORTS)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99451.333686.patch
Type: text/x-patch
Size: 1579 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210327/8489fabc/attachment.bin>
More information about the llvm-commits
mailing list