File: 0001-Prevent-FetchContent_Declare-with-empty-URL.patch

package info (click to toggle)
grcompiler 5.2.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 24,120 kB
  • sloc: cpp: 48,200; ansic: 7,666; sh: 4,427; makefile: 198; xml: 190; perl: 127; sed: 21
file content (25 lines) | stat: -rw-r--r-- 884 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Origin: upstream, f49b87f66cd40429a56bbb46e215a6d4e4be33d5
From: Tim Eves <tim-eves@users.noreply.github.com>
Date: Wed, 13 Mar 2024 21:29:14 +0700
Subject: Fix change in FetchContent_Decl behaviour in CMake 3.28

Older versions used to handle an empty URL parameter by doing nothing, now it errors.
---
 compiler/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler/CMakeLists.txt b/compiler/CMakeLists.txt
index 2b49253..cefe4bd 100644
--- a/compiler/CMakeLists.txt
+++ b/compiler/CMakeLists.txt
@@ -1,9 +1,9 @@
 project(compiler VERSION 5.2.1)
 cmake_policy(SET CMP0074 NEW)
 
-FetchContent_Declare(icu URL ${ICU_URL})
 
 if (DEFINED ICU_URL OR DEFINED FETCHCONTENT_SOURCE_DIR_ICU)
+    FetchContent_Declare(icu URL ${ICU_URL})
     FetchContent_GetProperties(icu)
     if (NOT icu_POPULATED)
         message(STATUS "Fetching: " ${ICU_URL})