$NetBSD: patch-llvm_CMakeLists.txt,v 1.3 2025/08/22 14:36:05 wiz Exp $ Fix build with cmake 4. On Darwin, use correct install_name. --- llvm/CMakeLists.txt.orig 2020-06-21 12:03:54.000000000 +0000 +++ llvm/CMakeLists.txt @@ -1,6 +1,6 @@ # See docs/CMake.html for instructions about how to build LLVM with CMake. -cmake_minimum_required(VERSION 2.8.7) +cmake_minimum_required(VERSION 3.5) set(LLVM_INSTALL_TOOLCHAIN_ONLY ON) @@ -13,15 +13,6 @@ if(POLICY CMP0022) cmake_policy(SET CMP0022 NEW) # automatic when 2.8.12 is required endif() -if (POLICY CMP0051) - # CMake 3.1 and higher include generator expressions of the form - # $ in the SOURCES property. These need to be - # stripped everywhere that access the SOURCES property, so we just - # defer to the OLD behavior of not including generator expressions - # in the output for now. - cmake_policy(SET CMP0051 OLD) -endif() - if(CMAKE_VERSION VERSION_LESS 3.1.20141117) set(cmake_3_2_USES_TERMINAL) else() @@ -455,8 +446,6 @@ set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LL set(CMAKE_BUILD_WITH_INSTALL_RPATH ON) if (APPLE) - set(CMAKE_INSTALL_NAME_DIR "@rpath") - set(CMAKE_INSTALL_RPATH "@executable_path/../lib") else(UNIX) if(NOT DEFINED CMAKE_INSTALL_RPATH) set(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}")