(no commit message)
[lldb-experimental.git] / cmake-old2.patch
1 commit afa1afd4108d973e059e5f5ad68cf01efe7985da
2 Author: Louis Dionne <ldionne@apple.com>
3 Date:   Wed Apr 22 11:15:05 2020 -0400
4
5     [CMake] Bump CMake minimum version to 3.13.4
6     
7     This upgrade should be friction-less because we've already been ensuring
8     that CMake >= 3.13.4 is used.
9     
10     This is part of the effort discussed on llvm-dev here:
11     
12       http://lists.llvm.org/pipermail/llvm-dev/2020-April/140578.html
13     
14     Differential Revision: https://reviews.llvm.org/D78648
15
16 diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
17 index 948452661a3..1a6a20a271f 100644
18 --- a/clang/CMakeLists.txt
19 +++ b/clang/CMakeLists.txt
20 @@ -1,4 +1,4 @@
21 -cmake_minimum_required(VERSION 3.4.3)
22 +cmake_minimum_required(VERSION 3.13.4)
23  
24  if(POLICY CMP0075)
25    cmake_policy(SET CMP0075 NEW)
26 diff --git a/clang/tools/scan-build-py/tests/functional/exec/CMakeLists.txt b/clang/tools/scan-build-py/tests/functional/exec/CMakeLists.txt
27 index 42ee1d11db8..007ad4530d6 100644
28 --- a/clang/tools/scan-build-py/tests/functional/exec/CMakeLists.txt
29 +++ b/clang/tools/scan-build-py/tests/functional/exec/CMakeLists.txt
30 @@ -1,6 +1,6 @@
31  project(exec C)
32  
33 -cmake_minimum_required(VERSION 3.4.3)
34 +cmake_minimum_required(VERSION 3.13.4)
35  
36  include(CheckCCompilerFlag)
37  check_c_compiler_flag("-std=c99" C99_SUPPORTED)
38 diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt
39 index fa62814b635..cfbd07a40e1 100644
40 --- a/compiler-rt/CMakeLists.txt
41 +++ b/compiler-rt/CMakeLists.txt
42 @@ -3,7 +3,7 @@
43  # An important constraint of the build is that it only produces libraries
44  # based on the ability of the host toolchain to target various platforms.
45  
46 -cmake_minimum_required(VERSION 3.4.3)
47 +cmake_minimum_required(VERSION 3.13.4)
48  
49  if(POLICY CMP0075)
50    cmake_policy(SET CMP0075 NEW)
51 diff --git a/compiler-rt/cmake/Modules/CustomLibcxx/CMakeLists.txt b/compiler-rt/cmake/Modules/CustomLibcxx/CMakeLists.txt
52 index e61c222587e..26d17ce6f14 100644
53 --- a/compiler-rt/cmake/Modules/CustomLibcxx/CMakeLists.txt
54 +++ b/compiler-rt/cmake/Modules/CustomLibcxx/CMakeLists.txt
55 @@ -1,4 +1,4 @@
56 -cmake_minimum_required(VERSION 3.4.3)
57 +cmake_minimum_required(VERSION 3.13.4)
58  project(custom-libcxx C CXX)
59  
60  # Build static libcxxabi.
61 diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt
62 index 058bfc815a1..99aed905d75 100644
63 --- a/compiler-rt/lib/builtins/CMakeLists.txt
64 +++ b/compiler-rt/lib/builtins/CMakeLists.txt
65 @@ -3,7 +3,7 @@
66  # architecture-specific code in various subdirectories.
67  
68  if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
69 -  cmake_minimum_required(VERSION 3.4.3)
70 +  cmake_minimum_required(VERSION 3.13.4)
71  
72    project(CompilerRTBuiltins C ASM)
73    set(COMPILER_RT_STANDALONE_BUILD TRUE)
74 diff --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt
75 index 13e675f1096..9dd6281d410 100644
76 --- a/flang/CMakeLists.txt
77 +++ b/flang/CMakeLists.txt
78 @@ -1,4 +1,4 @@
79 -cmake_minimum_required(VERSION 3.9.0)
80 +cmake_minimum_required(VERSION 3.13.4)
81  
82  # RPATH settings on macOS do not affect INSTALL_NAME.
83  if (POLICY CMP0068)
84 diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
85 index 9472f191fbd..c12dc10fa45 100644
86 --- a/libclc/CMakeLists.txt
87 +++ b/libclc/CMakeLists.txt
88 @@ -1,4 +1,4 @@
89 -cmake_minimum_required( VERSION 3.9.2 )
90 +cmake_minimum_required(VERSION 3.13.4)
91  
92  project( libclc VERSION 0.2.0 LANGUAGES CXX )
93  include( GNUInstallDirs )
94 diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
95 index caf655d6799..a5adccf62a9 100644
96 --- a/libcxx/CMakeLists.txt
97 +++ b/libcxx/CMakeLists.txt
98 @@ -8,7 +8,7 @@ endif()
99  #===============================================================================
100  # Setup Project
101  #===============================================================================
102 -cmake_minimum_required(VERSION 3.4.3)
103 +cmake_minimum_required(VERSION 3.13.4)
104  
105  if(POLICY CMP0042)
106    cmake_policy(SET CMP0042 NEW) # Set MACOSX_RPATH=YES by default
107 diff --git a/libcxx/utils/ci/runtimes/CMakeLists.txt b/libcxx/utils/ci/runtimes/CMakeLists.txt
108 index 43ebf9e4a19..f46ef63b809 100644
109 --- a/libcxx/utils/ci/runtimes/CMakeLists.txt
110 +++ b/libcxx/utils/ci/runtimes/CMakeLists.txt
111 @@ -1,4 +1,4 @@
112 -cmake_minimum_required(VERSION 3.4.3)
113 +cmake_minimum_required(VERSION 3.13.4)
114  
115  if(POLICY CMP0068)
116    cmake_policy(SET CMP0068 NEW)
117 diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt
118 index e4e20d950b8..534ef7e8c84 100644
119 --- a/libcxxabi/CMakeLists.txt
120 +++ b/libcxxabi/CMakeLists.txt
121 @@ -8,7 +8,7 @@ endif()
122  # Setup Project
123  #===============================================================================
124  
125 -cmake_minimum_required(VERSION 3.4.3)
126 +cmake_minimum_required(VERSION 3.13.4)
127  
128  if(POLICY CMP0042)
129    cmake_policy(SET CMP0042 NEW) # Set MACOSX_RPATH=YES by default
130 diff --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt
131 index b50550dc376..c5b536532f3 100644
132 --- a/libunwind/CMakeLists.txt
133 +++ b/libunwind/CMakeLists.txt
134 @@ -2,7 +2,7 @@
135  # Setup Project
136  #===============================================================================
137  
138 -cmake_minimum_required(VERSION 3.4.3)
139 +cmake_minimum_required(VERSION 3.13.4)
140  
141  if (POLICY CMP0042)
142    cmake_policy(SET CMP0042 NEW) # Set MACOSX_RPATH=YES by default
143 diff --git a/lld/CMakeLists.txt b/lld/CMakeLists.txt
144 index 5090c935e75..e9bd1bd29c5 100644
145 --- a/lld/CMakeLists.txt
146 +++ b/lld/CMakeLists.txt
147 @@ -1,7 +1,7 @@
148  # Check if lld is built as a standalone project.
149  if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
150    project(lld)
151 -  cmake_minimum_required(VERSION 3.4.3)
152 +  cmake_minimum_required(VERSION 3.13.4)
153  
154    set(CMAKE_INCLUDE_CURRENT_DIR ON)
155    set(LLD_BUILT_STANDALONE TRUE)
156 diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt
157 index b1c0597cf3b..14cfba1f64f 100644
158 --- a/lldb/CMakeLists.txt
159 +++ b/lldb/CMakeLists.txt
160 @@ -1,7 +1,4 @@
161 -cmake_minimum_required(VERSION 3.4.3)
162 -if(CMAKE_SYSTEM_NAME STREQUAL Windows)
163 -  cmake_minimum_required(VERSION 3.13)
164 -endif()
165 +cmake_minimum_required(VERSION 3.13.4)
166  
167  if(POLICY CMP0075)
168    cmake_policy(SET CMP0075 NEW)
169 diff --git a/lldb/tools/debugserver/CMakeLists.txt b/lldb/tools/debugserver/CMakeLists.txt
170 index fc23cf3c7e2..eba5c414913 100644
171 --- a/lldb/tools/debugserver/CMakeLists.txt
172 +++ b/lldb/tools/debugserver/CMakeLists.txt
173 @@ -1,4 +1,4 @@
174 -cmake_minimum_required(VERSION 3.4.3)
175 +cmake_minimum_required(VERSION 3.13.4)
176  
177  project(Debugserver LANGUAGES C CXX ASM-ATT)
178  
179 diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
180 index a3353a40238..ddf80715632 100644
181 --- a/llvm/CMakeLists.txt
182 +++ b/llvm/CMakeLists.txt
183 @@ -1,12 +1,6 @@
184  # See docs/CMake.html for instructions about how to build LLVM with CMake.
185  
186 -cmake_minimum_required(VERSION 3.4.3)
187 -
188 -if ("${CMAKE_VERSION}" VERSION_LESS "3.13.4")
189 -  message(FATAL_ERROR
190 -    "Your CMake version is ${CMAKE_VERSION}. The minimum version of CMake "
191 -    "required to build LLVM is now 3.13.4.")
192 -endif()
193 +cmake_minimum_required(VERSION 3.13.4)
194  
195  if(POLICY CMP0068)
196    cmake_policy(SET CMP0068 NEW)
197 diff --git a/llvm/docs/CMake.rst b/llvm/docs/CMake.rst
198 index 1f908d3e95b..f96e34f21e8 100644
199 --- a/llvm/docs/CMake.rst
200 +++ b/llvm/docs/CMake.rst
201 @@ -34,7 +34,7 @@ Quick start
202  We use here the command-line, non-interactive CMake interface.
203  
204  #. `Download <http://www.cmake.org/cmake/resources/software.html>`_ and install
205 -   CMake. Version 3.4.3 is the minimum required.
206 +   CMake. Version 3.13.4 is the minimum required.
207  
208  #. Open a shell. Your development tools must be reachable from this shell
209     through the PATH environment variable.
210 @@ -717,7 +717,7 @@ and uses them to build a simple application ``simple-tool``.
211  
212  .. code-block:: cmake
213  
214 -  cmake_minimum_required(VERSION 3.4.3)
215 +  cmake_minimum_required(VERSION 3.13.4)
216    project(SimpleProject)
217  
218    find_package(LLVM REQUIRED CONFIG)
219 diff --git a/llvm/docs/CMakePrimer.rst b/llvm/docs/CMakePrimer.rst
220 index abfd08017fb..bc63ac1c027 100644
221 --- a/llvm/docs/CMakePrimer.rst
222 +++ b/llvm/docs/CMakePrimer.rst
223 @@ -54,7 +54,7 @@ program. The example uses only CMake language-defined functions.
224  
225  .. code-block:: cmake
226  
227 -   cmake_minimum_required(VERSION 3.2)
228 +   cmake_minimum_required(VERSION 3.15)
229     project(HelloWorld)
230     add_executable(HelloWorld HelloWorld.cpp)
231  
232 @@ -64,13 +64,13 @@ block to define "APPLE" when targeting Apple platforms:
233  
234  .. code-block:: cmake
235  
236 -   cmake_minimum_required(VERSION 3.2)
237 +   cmake_minimum_required(VERSION 3.15)
238     project(HelloWorld)
239     add_executable(HelloWorld HelloWorld.cpp)
240     if(APPLE)
241       target_compile_definitions(HelloWorld PUBLIC APPLE)
242     endif()
243 -   
244 +
245  Variables, Types, and Scope
246  ===========================
247  
248 @@ -93,7 +93,7 @@ example:
249     set(var_name var1)
250     set(${var_name} foo) # same as "set(var1 foo)"
251     set(${${var_name}}_var bar) # same as "set(foo_var bar)"
252 -   
253 +
254  Dereferencing an unset variable results in an empty expansion. It is a common
255  pattern in CMake to conditionally set variables knowing that it will be used in
256  code paths that the variable isn't set. There are examples of this throughout
257 @@ -107,7 +107,7 @@ An example of variable empty expansion is:
258       set(extra_sources Apple.cpp)
259     endif()
260     add_executable(HelloWorld HelloWorld.cpp ${extra_sources})
261 -   
262 +
263  In this example the ``extra_sources`` variable is only defined if you're
264  targeting an Apple platform. For all other targets the ``extra_sources`` will be
265  evaluated as empty before add_executable is given its arguments.
266 @@ -124,7 +124,7 @@ defining lists:
267     # Creates a list with members a, b, c, and d
268     set(my_list a b c d)
269     set(my_list "a;b;c;d")
270 -   
271 +
272     # Creates a string "a b c d"
273     set(my_string "a b c d")
274  
275 @@ -141,7 +141,7 @@ make a list of variable names that refer to other lists. For example:
276     set(a 1 2 3)
277     set(b 4 5 6)
278     set(c 7 8 9)
279 -   
280 +
281  With this layout you can iterate through the list of lists printing each value
282  with the following code:
283  
284 @@ -152,7 +152,7 @@ with the following code:
285         message(${value})
286       endforeach()
287     endforeach()
288 -   
289 +
290  You'll notice that the inner foreach loop's list is doubly dereferenced. This is
291  because the first dereference turns ``list_name`` into the name of the sub-list
292  (a, b, or c in the example), then the second dereference is to get the value of
293 @@ -385,7 +385,7 @@ result in some unexpected behavior if using unreferenced variables. For example:
294         message("${var}")
295       endforeach()
296     endmacro()
297 -   
298 +
299     set(my_list a b c d)
300     set(my_list_of_numbers 1 2 3 4)
301     print_list(my_list_of_numbers)
302 diff --git a/llvm/docs/GettingStarted.rst b/llvm/docs/GettingStarted.rst
303 index 478571bd4c2..c30ebecc89e 100644
304 --- a/llvm/docs/GettingStarted.rst
305 +++ b/llvm/docs/GettingStarted.rst
306 @@ -167,7 +167,7 @@ uses the package and provides other details.
307  =========================================================== ============ ==========================================
308  Package                                                     Version      Notes
309  =========================================================== ============ ==========================================
310 -`CMake <http://cmake.org/>`__                               >=3.4.3      Makefile/workspace generator
311 +`CMake <http://cmake.org/>`__                               >=3.13.4     Makefile/workspace generator
312  `GCC <http://gcc.gnu.org/>`_                                >=5.1.0      C/C++ compiler\ :sup:`1`
313  `python <http://www.python.org/>`_                          >=2.7        Automated test suite\ :sup:`2`
314  `zlib <http://zlib.net>`_                                   >=1.2.3.4    Compression library\ :sup:`3`
315 diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt
316 index 0f29e24a26e..dc74a46c70b 100644
317 --- a/llvm/runtimes/CMakeLists.txt
318 +++ b/llvm/runtimes/CMakeLists.txt
319 @@ -7,7 +7,7 @@
320  # Setting CMake minimum required version should be at the very top of the file
321  # if this is the entry point.
322  if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
323 -  cmake_minimum_required(VERSION 3.4.3)
324 +  cmake_minimum_required(VERSION 3.13.4)
325    project(Runtimes C CXX ASM)
326  endif()
327  
328 @@ -56,7 +56,7 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
329      set_property(GLOBAL APPEND PROPERTY SUB_COMPONENTS ${name})
330    endfunction()
331  
332 -  cmake_minimum_required(VERSION 3.4.3)
333 +  cmake_minimum_required(VERSION 3.13.4)
334    project(Runtimes C CXX ASM)
335  
336    find_package(LLVM PATHS "${LLVM_BINARY_DIR}" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
337 diff --git a/llvm/utils/benchmark/CMakeLists.txt b/llvm/utils/benchmark/CMakeLists.txt
338 index 38bc8c6bc95..542c70ca494 100644
339 --- a/llvm/utils/benchmark/CMakeLists.txt
340 +++ b/llvm/utils/benchmark/CMakeLists.txt
341 @@ -1,4 +1,4 @@
342 -cmake_minimum_required (VERSION 2.8.12)
343 +cmake_minimum_required(VERSION 3.13.4)
344  
345  # Tell cmake 3.0+ that it's safe to clear the PROJECT_VERSION variable in the
346  # call to project() below.
347 diff --git a/mlir/examples/standalone/CMakeLists.txt b/mlir/examples/standalone/CMakeLists.txt
348 index 9f30f70f949..45dc80804aa 100644
349 --- a/mlir/examples/standalone/CMakeLists.txt
350 +++ b/mlir/examples/standalone/CMakeLists.txt
351 @@ -1,4 +1,4 @@
352 -cmake_minimum_required(VERSION 3.10)
353 +cmake_minimum_required(VERSION 3.13.4)
354  
355  if(POLICY CMP0068)
356    cmake_policy(SET CMP0068 NEW)
357 diff --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt
358 index 6f0d9e72800..f18688f08c4 100644
359 --- a/openmp/CMakeLists.txt
360 +++ b/openmp/CMakeLists.txt
361 @@ -1,4 +1,4 @@
362 -cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
363 +cmake_minimum_required(VERSION 3.13.4)
364  
365  # Add cmake directory to search for custom cmake functions.
366  set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
367 diff --git a/openmp/cmake/DetectTestCompiler/CMakeLists.txt b/openmp/cmake/DetectTestCompiler/CMakeLists.txt
368 index c230fc8d4cf..7fa32a90972 100644
369 --- a/openmp/cmake/DetectTestCompiler/CMakeLists.txt
370 +++ b/openmp/cmake/DetectTestCompiler/CMakeLists.txt
371 @@ -1,4 +1,4 @@
372 -cmake_minimum_required(VERSION 2.8)
373 +cmake_minimum_required(VERSION 3.13.4)
374  project(DetectTestCompiler C CXX)
375  
376  include(CheckCCompilerFlag)
377 diff --git a/openmp/runtime/cmake/LibompCheckLinkerFlag.cmake b/openmp/runtime/cmake/LibompCheckLinkerFlag.cmake
378 index 2b6cda676a6..e601e53f112 100644
379 --- a/openmp/runtime/cmake/LibompCheckLinkerFlag.cmake
380 +++ b/openmp/runtime/cmake/LibompCheckLinkerFlag.cmake
381 @@ -17,7 +17,7 @@ function(libomp_check_linker_flag flag boolean)
382    set(library_source
383      "int foo(int a) { return a*a; }")
384    set(cmake_source
385 -    "cmake_minimum_required(VERSION 2.8)
386 +    "cmake_minimum_required(VERSION 3.13.4)
387       project(foo C)
388       set(CMAKE_SHARED_LINKER_FLAGS \"${flag}\")
389       add_library(foo SHARED src_to_link.c)")
390 diff --git a/parallel-libs/CMakeLists.txt b/parallel-libs/CMakeLists.txt
391 index c1fcf45cd71..35ca8bc1bce 100644
392 --- a/parallel-libs/CMakeLists.txt
393 +++ b/parallel-libs/CMakeLists.txt
394 @@ -1 +1 @@
395 -cmake_minimum_required(VERSION 3.1)
396 +cmake_minimum_required(VERSION 3.13.4)
397 diff --git a/parallel-libs/acxxel/CMakeLists.txt b/parallel-libs/acxxel/CMakeLists.txt
398 index 547dd62d2fb..7e71446107a 100644
399 --- a/parallel-libs/acxxel/CMakeLists.txt
400 +++ b/parallel-libs/acxxel/CMakeLists.txt
401 @@ -1,4 +1,4 @@
402 -cmake_minimum_required(VERSION 3.1)
403 +cmake_minimum_required(VERSION 3.13.4)
404  
405  option(ACXXEL_ENABLE_UNIT_TESTS "enable acxxel unit tests" ON)
406  option(ACXXEL_ENABLE_MULTI_DEVICE_UNIT_TESTS "enable acxxel multi-device unit tests" OFF)
407 diff --git a/polly/CMakeLists.txt b/polly/CMakeLists.txt
408 index 9939097f743..2e94512b2cf 100644
409 --- a/polly/CMakeLists.txt
410 +++ b/polly/CMakeLists.txt
411 @@ -1,7 +1,7 @@
412  # Check if this is a in tree build.
413  if (NOT DEFINED LLVM_MAIN_SRC_DIR)
414    project(Polly)
415 -  cmake_minimum_required(VERSION 3.4.3)
416 +  cmake_minimum_required(VERSION 3.13.4)
417  
418    # Where is LLVM installed?
419    find_package(LLVM CONFIG REQUIRED)
420 diff --git a/pstl/CMakeLists.txt b/pstl/CMakeLists.txt
421 index 8e6e1354707..8bea8843589 100644
422 --- a/pstl/CMakeLists.txt
423 +++ b/pstl/CMakeLists.txt
424 @@ -5,7 +5,7 @@
425  # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
426  #
427  #===----------------------------------------------------------------------===##
428 -cmake_minimum_required(VERSION 3.4.3)
429 +cmake_minimum_required(VERSION 3.13.4)
430  
431  set(PARALLELSTL_VERSION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/include/pstl/internal/pstl_config.h")
432  file(STRINGS "${PARALLELSTL_VERSION_FILE}" PARALLELSTL_VERSION_SOURCE REGEX "#define _PSTL_VERSION .*$")