blob: b4634a2445d7b111f6ce24efd7ae7a3cde5674f9 [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001From 6a704ab7bf69cd5d6970b3a7d3ae7798b26027c1 Mon Sep 17 00:00:00 2001
2From: Paulo Neves <ptsneves@gmail.com>
3Date: Thu, 28 Jul 2022 11:28:41 +0200
4Subject: [PATCH] CMakeLists.txt Do not use private makefile $< target
5
6$< is a private detail from the Makefile generated by CMakefile and
7are not under control or to be used at the CMakeLists level. In 3.20
8that private generation changed pre-requisite targets[1] and now logs
9contain the path compiler_depend.ts instead of the actual file.
10
11Upstream status: Pending [1]
12[1] https://github.com/fluent/fluent-bit/issues/5492
13---
14 CMakeLists.txt | 6 +-----
15 lib/chunkio/CMakeLists.txt | 7 +------
16 lib/cmetrics/CMakeLists.txt | 7 +------
17 3 files changed, 3 insertions(+), 17 deletions(-)
18
19diff --git a/CMakeLists.txt b/CMakeLists.txt
20index 3dba5a8..d94b988 100644
21--- a/CMakeLists.txt
22+++ b/CMakeLists.txt
23@@ -46,11 +46,7 @@ else()
24 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
25 endif()
26
27-if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows")
28- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__='\"$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<))\"'")
29-else()
30- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__")
31-endif()
32+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__")
33
34 if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7l")
35 set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -latomic")
36diff --git a/lib/chunkio/CMakeLists.txt b/lib/chunkio/CMakeLists.txt
37index bbe1f39..809ea93 100644
38--- a/lib/chunkio/CMakeLists.txt
39+++ b/lib/chunkio/CMakeLists.txt
40@@ -14,12 +14,7 @@ else()
41 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall ")
42 endif()
43
44-# Set __FILENAME__
45-if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows")
46- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__='\"$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<))\"'")
47-else()
48- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__")
49-endif()
50+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__")
51
52 include(cmake/macros.cmake)
53
54diff --git a/lib/cmetrics/CMakeLists.txt b/lib/cmetrics/CMakeLists.txt
55index 60e8774..e3d6149 100644
56--- a/lib/cmetrics/CMakeLists.txt
57+++ b/lib/cmetrics/CMakeLists.txt
58@@ -34,12 +34,7 @@ set(CMT_VERSION_MINOR 3)
59 set(CMT_VERSION_PATCH 5)
60 set(CMT_VERSION_STR "${CMT_VERSION_MAJOR}.${CMT_VERSION_MINOR}.${CMT_VERSION_PATCH}")
61
62-# Define __FILENAME__ consistently across Operating Systems
63-if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows")
64- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__='\"$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<))\"'")
65-else()
66- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__")
67-endif()
68+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__")
69
70 # Configuration options
71 option(CMT_DEV "Enable development mode" No)