[Lldb-commits] [lldb] 480643a - [CMake] Remove dead code setting policies to NEW
Author: Raul Tambre Date: 2021-01-19T17:19:36+02:00 New Revision: 480643a95cd157e654f4f97e8231b18850e7d79a URL: https://github.com/llvm/llvm-project/commit/480643a95cd157e654f4f97e8231b18850e7d79a DIFF: https://github.com/llvm/llvm-project/commit/480643a95cd157e654f4f97e8231b18850e7d79a.diff LOG: [CMake] Remove dead code setting policies to NEW cmake_minimum_required(VERSION) calls cmake_policy(VERSION), which sets all policies up to VERSION to NEW. LLVM started requiring CMake 3.13 last year, so we can remove a bunch of code setting policies prior to 3.13 to NEW as it no longer has any effect. Reviewed By: phosek, #libunwind, #libc, #libc_abi, ldionne Differential Revision: https://reviews.llvm.org/D94374 Added: Modified: clang/CMakeLists.txt compiler-rt/CMakeLists.txt flang/CMakeLists.txt libcxx/CMakeLists.txt libcxx/utils/ci/runtimes/CMakeLists.txt libcxxabi/CMakeLists.txt libunwind/CMakeLists.txt lldb/CMakeLists.txt llvm/CMakeLists.txt mlir/examples/standalone/CMakeLists.txt Removed: diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt index f1e5a39cfe05..9e74014134a0 100644 --- a/clang/CMakeLists.txt +++ b/clang/CMakeLists.txt @@ -1,9 +1,5 @@ cmake_minimum_required(VERSION 3.13.4) -if(POLICY CMP0075) - cmake_policy(SET CMP0075 NEW) -endif() - # If we are not building as a part of LLVM, build Clang as an # standalone project, using LLVM as an external library: if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt index 30302c2c1427..b44ad2c2118e 100644 --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/CMakeLists.txt @@ -5,10 +5,6 @@ cmake_minimum_required(VERSION 3.13.4) -if(POLICY CMP0075) - cmake_policy(SET CMP0075 NEW) -endif() - # Check if compiler-rt is built as a standalone project. if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR COMPILER_RT_STANDALONE_BUILD) project(CompilerRT C CXX ASM) diff --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt index 07d34354bd81..79aa53830d5e 100644 --- a/flang/CMakeLists.txt +++ b/flang/CMakeLists.txt @@ -1,20 +1,6 @@ cmake_minimum_required(VERSION 3.13.4) -# RPATH settings on macOS do not affect INSTALL_NAME. -if (POLICY CMP0068) - cmake_policy(SET CMP0068 NEW) - set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) -endif() - -# Include file check macros honor CMAKE_REQUIRED_LIBRARIES. -if(POLICY CMP0075) - cmake_policy(SET CMP0075 NEW) -endif() - -# option() honors normal variables. -if (POLICY CMP0077) - cmake_policy(SET CMP0077 NEW) -endif() +set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) option(LINK_WITH_FIR "Link driver with FIR and LLVM" ON) option(FLANG_BUILD_NEW_DRIVER "Build the flang compiler driver" OFF) diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt index f4c7e9992f71..46a669500548 100644 --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -10,16 +10,7 @@ endif() #=== cmake_minimum_required(VERSION 3.13.4) -if(POLICY CMP0042) - cmake_policy(SET CMP0042 NEW) # Set MACOSX_RPATH=YES by default -endif() -if(POLICY CMP0022) - cmake_policy(SET CMP0022 NEW) # Required when interacting with LLVM and Clang -endif() -if(POLICY CMP0068) - cmake_policy(SET CMP0068 NEW) - set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) -endif() +set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) # Add path for custom modules set(CMAKE_MODULE_PATH diff --git a/libcxx/utils/ci/runtimes/CMakeLists.txt b/libcxx/utils/ci/runtimes/CMakeLists.txt index 20980b530d4d..ab4182ae949e 100644 --- a/libcxx/utils/ci/runtimes/CMakeLists.txt +++ b/libcxx/utils/ci/runtimes/CMakeLists.txt @@ -1,20 +1,8 @@ cmake_minimum_required(VERSION 3.13.4) - -if(POLICY CMP0068) - cmake_policy(SET CMP0068 NEW) - set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) -endif() - -if(POLICY CMP0075) - cmake_policy(SET CMP0075 NEW) -endif() - -if(POLICY CMP0077) - cmake_policy(SET CMP0077 NEW) -endif() - project(LLVM_RUNTIMES) +set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) + find_package(Python3 COMPONENTS Interpreter) if(NOT Python3_Interpreter_FOUND) message(WARNING "Python3 not found, using python2 as a fallback") diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt index 146749f57b0a..c8ab9d7acb1d 100644 --- a/libcxxabi/CMakeLists.txt +++ b/libcxxabi/CMakeLists.txt @@ -10,10 +10,6 @@ endif() cmake_minimum_required(VERSION 3.13.4) -if(POLICY CMP0042) - cmake_policy(SET CMP0042 NEW) # Set MACOSX_RPATH=YES by default -endif() - # Add path for custom modules set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" diff --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt index e344263173b0..8ae32fbccf4e 100644 --- a/libunwind/CMakeLists.txt +++ b/libunwind/CMakeLists.txt @@ -8,10 +8,6 @@ endif() cmake_minimum_required(VERSION 3.13.4) -
[Lldb-commits] [lldb] [lldb] Symlink Python binding to fully soversioned library (PR #110557)
https://github.com/tambry created https://github.com/llvm/llvm-project/pull/110557 In Debian packaging the soversionless library is typically put into a -dev package and links to the current soversion things should be built against. This means that installing the bindings requires unnecessarily installing the -dev package in addition to the library package itself. There's no downside to linking to the full soversion since I don't think liblldb and the bindings are compatible across major versions anyway. >From b2285e0bd808cc876e69061127c3bc5fb5066074 Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Mon, 30 Sep 2024 22:20:12 +0300 Subject: [PATCH] [lldb] Symlink Python binding to fully soversioned library In Debian packaging the soversionless library is typically put into a -dev package and links to the current soversion things should be built against. This means that installing the bindings requires unnecessarily installing the -dev package in addition to the library package itself. There's no downside to linking to the full soversion since I don't think liblldb and the bindings are compatible across major versions anyway. --- lldb/bindings/python/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/bindings/python/CMakeLists.txt b/lldb/bindings/python/CMakeLists.txt index 69306a384e0b1c..136cdba65b37f8 100644 --- a/lldb/bindings/python/CMakeLists.txt +++ b/lldb/bindings/python/CMakeLists.txt @@ -137,7 +137,7 @@ function(finish_swig_python swig_target lldb_python_bindings_dir lldb_python_tar if(LLDB_BUILD_FRAMEWORK) set(LIBLLDB_SYMLINK_DEST "${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/LLDB.framework/LLDB") else() -set(LIBLLDB_SYMLINK_DEST "${LLVM_SHLIB_OUTPUT_INTDIR}/liblldb${CMAKE_SHARED_LIBRARY_SUFFIX}") +set(LIBLLDB_SYMLINK_DEST "${LLVM_SHLIB_OUTPUT_INTDIR}/liblldb${CMAKE_SHARED_LIBRARY_SUFFIX}.${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}") endif() set(LIBLLDB_SYMLINK_OUTPUT_FILE "_lldb${LLDB_PYTHON_EXT_SUFFIX}") create_relative_symlink(${swig_target} ${LIBLLDB_SYMLINK_DEST} ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][Telemetry] Fix unit test compile failure with LLVM_ENABLE_TELEMETRY=0 (PR #136115)
https://github.com/tambry created https://github.com/llvm/llvm-project/pull/136115 It needs to be `TEST_F` to access `received_entries`. Disabling also works based on the test not the fixture name. Build failure: ``` lldb/unittests/Core/TelemetryTest.cpp:110:17: error: use of undeclared identifier 'received_entries' 110 | ASSERT_EQ(1U, received_entries.size()); | ^ lldb/unittests/Core/TelemetryTest.cpp:112:61: error: use of undeclared identifier 'received_entries' 112 | llvm::dyn_cast(received_entries[0]) | ^ ``` Fixes: 159b872b37363511a359c800bcc9230bb09f2457 >From 2c93219ad894416e87458bfed2d2745e29b5bbe0 Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Thu, 17 Apr 2025 12:21:32 +0300 Subject: [PATCH] [lldb][Telemetry] Fix unit test compile failure with LLVM_ENABLE_TELEMETRY=0 It needs to be `TEST_F` to access `received_entries`. Disabling also works based on the test not the fixture name. Build failure: ``` lldb/unittests/Core/TelemetryTest.cpp:110:17: error: use of undeclared identifier 'received_entries' 110 | ASSERT_EQ(1U, received_entries.size()); | ^ lldb/unittests/Core/TelemetryTest.cpp:112:61: error: use of undeclared identifier 'received_entries' 112 | llvm::dyn_cast(received_entries[0]) | ^ ``` Fixes: 159b872b37363511a359c800bcc9230bb09f2457 --- lldb/unittests/Core/TelemetryTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/unittests/Core/TelemetryTest.cpp b/lldb/unittests/Core/TelemetryTest.cpp index 1e41424bac3ce..910149d865c13 100644 --- a/lldb/unittests/Core/TelemetryTest.cpp +++ b/lldb/unittests/Core/TelemetryTest.cpp @@ -96,7 +96,7 @@ class TelemetryTest : public testing::Test { #if LLVM_ENABLE_TELEMETRY #define TELEMETRY_TEST(suite, test) TEST_F(suite, test) #else -#define TELEMETRY_TEST(suite, test) TEST(DISABLED_##suite, test) +#define TELEMETRY_TEST(suite, test) TEST_F(suite, DISABLED_##test) #endif TELEMETRY_TEST(TelemetryTest, PluginTest) { ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][Telemetry] Fix unit test compile failure with LLVM_ENABLE_TELEMETRY=0 (PR #136115)
https://github.com/tambry closed https://github.com/llvm/llvm-project/pull/136115 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Symlink Python binding to fully soversioned library (PR #110557)
https://github.com/tambry closed https://github.com/llvm/llvm-project/pull/110557 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Symlink Python binding to fully soversioned library (PR #110557)
tambry wrote: I'll return to this once I find the time. https://github.com/llvm/llvm-project/pull/110557 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits