[llvm] a85f585 - [LLVM] Removes CMake work-arounds.
Mark de Wever via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 7 09:04:19 PDT 2023
Author: Mark de Wever
Date: 2023-06-07T18:04:13+02:00
New Revision: a85f585b1ea9dc4a29150bf4fe5b08bceab95926
URL: https://github.com/llvm/llvm-project/commit/a85f585b1ea9dc4a29150bf4fe5b08bceab95926
DIFF: https://github.com/llvm/llvm-project/commit/a85f585b1ea9dc4a29150bf4fe5b08bceab95926.diff
LOG: [LLVM] Removes CMake work-arounds.
CMake older than 3.20.0 is no longer supported.
This removes work-arounds for no longer supported versions.
Reviewed By: kwk
Differential Revision: https://reviews.llvm.org/D152103
Added:
Modified:
llvm/CMakeLists.txt
llvm/docs/CMakePrimer.rst
Removed:
################################################################################
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 637b87552a625..0b61ebc3461ae 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -1064,29 +1064,6 @@ if (UNIX AND ${CMAKE_SYSTEM_NAME} MATCHES "AIX")
add_compile_definitions(_XOPEN_SOURCE=700)
add_compile_definitions(_LARGE_FILE_API)
- # CMake versions less than 3.16 set default linker flags to include -brtl, as
- # well as setting -G when building libraries, so clear them out. Note we only
- # try to clear the form that CMake will set as part of its initial
- # configuration, it is still possible the user may force it as part of a
- # compound option.
- if(CMAKE_VERSION VERSION_LESS 3.16)
- string(REGEX REPLACE "(^|[ \t]+)-Wl,-brtl([ \t]+|$)" " " CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
- string(REGEX REPLACE "(^|[ \t]+)-Wl,-brtl([ \t]+|$)" " " CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
- string(REGEX REPLACE "(^|[ \t]+)-Wl,-brtl([ \t]+|$)" " " CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}")
- string(REGEX REPLACE "(^|[ \t]+)(-Wl,)?-G([ \t]+|$)" " " CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS
- "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}")
- string(REGEX REPLACE "(^|[ \t]+)(-Wl,)?-G([ \t]+|$)" " " CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS
- "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}")
- string(REGEX REPLACE "(^|[ \t]+)(-Wl,)?-G([ \t]+|$)" " " CMAKE_SHARED_LIBRARY_CREATE_ASM_FLAGS
- "${CMAKE_SHARED_LIBRARY_CREATE_ASM_FLAGS}")
- string(REGEX REPLACE "(^|[ \t]+)-Wl,-G," " -Wl," CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS
- "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}")
- string(REGEX REPLACE "(^|[ \t]+)-Wl,-G," " -Wl," CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS
- "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}")
- string(REGEX REPLACE "(^|[ \t]+)-Wl,-G," " -Wl," CMAKE_SHARED_LIBRARY_CREATE_ASM_FLAGS
- "${CMAKE_SHARED_LIBRARY_CREATE_ASM_FLAGS}")
- endif()
-
# Modules should be built with -shared -Wl,-G, so we can use runtime linking
# with plugins.
string(APPEND CMAKE_MODULE_LINKER_FLAGS " -shared -Wl,-G")
diff --git a/llvm/docs/CMakePrimer.rst b/llvm/docs/CMakePrimer.rst
index bc63ac1c02734..d7895ce3b6274 100644
--- a/llvm/docs/CMakePrimer.rst
+++ b/llvm/docs/CMakePrimer.rst
@@ -54,7 +54,7 @@ program. The example uses only CMake language-defined functions.
.. code-block:: cmake
- cmake_minimum_required(VERSION 3.15)
+ cmake_minimum_required(VERSION 3.20.0)
project(HelloWorld)
add_executable(HelloWorld HelloWorld.cpp)
@@ -64,7 +64,7 @@ block to define "APPLE" when targeting Apple platforms:
.. code-block:: cmake
- cmake_minimum_required(VERSION 3.15)
+ cmake_minimum_required(VERSION 3.20.0)
project(HelloWorld)
add_executable(HelloWorld HelloWorld.cpp)
if(APPLE)
More information about the llvm-commits
mailing list