Skip to content

Commit a85f585

Browse files
committed
[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
1 parent 7fdf2b2 commit a85f585

File tree

2 files changed

+2
-25
lines changed

2 files changed

+2
-25
lines changed

llvm/CMakeLists.txt

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,29 +1064,6 @@ if (UNIX AND ${CMAKE_SYSTEM_NAME} MATCHES "AIX")
10641064
add_compile_definitions(_XOPEN_SOURCE=700)
10651065
add_compile_definitions(_LARGE_FILE_API)
10661066

1067-
# CMake versions less than 3.16 set default linker flags to include -brtl, as
1068-
# well as setting -G when building libraries, so clear them out. Note we only
1069-
# try to clear the form that CMake will set as part of its initial
1070-
# configuration, it is still possible the user may force it as part of a
1071-
# compound option.
1072-
if(CMAKE_VERSION VERSION_LESS 3.16)
1073-
string(REGEX REPLACE "(^|[ \t]+)-Wl,-brtl([ \t]+|$)" " " CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
1074-
string(REGEX REPLACE "(^|[ \t]+)-Wl,-brtl([ \t]+|$)" " " CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
1075-
string(REGEX REPLACE "(^|[ \t]+)-Wl,-brtl([ \t]+|$)" " " CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}")
1076-
string(REGEX REPLACE "(^|[ \t]+)(-Wl,)?-G([ \t]+|$)" " " CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS
1077-
"${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}")
1078-
string(REGEX REPLACE "(^|[ \t]+)(-Wl,)?-G([ \t]+|$)" " " CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS
1079-
"${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}")
1080-
string(REGEX REPLACE "(^|[ \t]+)(-Wl,)?-G([ \t]+|$)" " " CMAKE_SHARED_LIBRARY_CREATE_ASM_FLAGS
1081-
"${CMAKE_SHARED_LIBRARY_CREATE_ASM_FLAGS}")
1082-
string(REGEX REPLACE "(^|[ \t]+)-Wl,-G," " -Wl," CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS
1083-
"${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}")
1084-
string(REGEX REPLACE "(^|[ \t]+)-Wl,-G," " -Wl," CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS
1085-
"${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}")
1086-
string(REGEX REPLACE "(^|[ \t]+)-Wl,-G," " -Wl," CMAKE_SHARED_LIBRARY_CREATE_ASM_FLAGS
1087-
"${CMAKE_SHARED_LIBRARY_CREATE_ASM_FLAGS}")
1088-
endif()
1089-
10901067
# Modules should be built with -shared -Wl,-G, so we can use runtime linking
10911068
# with plugins.
10921069
string(APPEND CMAKE_MODULE_LINKER_FLAGS " -shared -Wl,-G")

llvm/docs/CMakePrimer.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ program. The example uses only CMake language-defined functions.
5454

5555
.. code-block:: cmake
5656
57-
cmake_minimum_required(VERSION 3.15)
57+
cmake_minimum_required(VERSION 3.20.0)
5858
project(HelloWorld)
5959
add_executable(HelloWorld HelloWorld.cpp)
6060
@@ -64,7 +64,7 @@ block to define "APPLE" when targeting Apple platforms:
6464

6565
.. code-block:: cmake
6666
67-
cmake_minimum_required(VERSION 3.15)
67+
cmake_minimum_required(VERSION 3.20.0)
6868
project(HelloWorld)
6969
add_executable(HelloWorld HelloWorld.cpp)
7070
if(APPLE)

0 commit comments

Comments
 (0)