1From 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 [https://github.com/fluent/fluent-bit/issues/5492] 12--- 13 CMakeLists.txt | 6 +----- 14 lib/chunkio/CMakeLists.txt | 7 +------ 15 lib/cmetrics/CMakeLists.txt | 7 +------ 16 3 files changed, 3 insertions(+), 17 deletions(-) 17 18diff --git a/CMakeLists.txt b/CMakeLists.txt 19index 3dba5a8..d94b988 100644 20--- a/CMakeLists.txt 21+++ b/CMakeLists.txt 22@@ -46,11 +46,7 @@ else() 23 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") 24 endif() 25 26-if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows") 27- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__='\"$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<))\"'") 28-else() 29- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__") 30-endif() 31+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__") 32 33 if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7l") 34 set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -latomic") 35diff --git a/lib/chunkio/CMakeLists.txt b/lib/chunkio/CMakeLists.txt 36index bbe1f39..809ea93 100644 37--- a/lib/chunkio/CMakeLists.txt 38+++ b/lib/chunkio/CMakeLists.txt 39@@ -14,12 +14,7 @@ else() 40 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall ") 41 endif() 42 43-# Set __FILENAME__ 44-if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows") 45- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__='\"$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<))\"'") 46-else() 47- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__") 48-endif() 49+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__") 50 51 include(cmake/macros.cmake) 52 53diff --git a/lib/cmetrics/CMakeLists.txt b/lib/cmetrics/CMakeLists.txt 54index 60e8774..e3d6149 100644 55--- a/lib/cmetrics/CMakeLists.txt 56+++ b/lib/cmetrics/CMakeLists.txt 57@@ -34,12 +34,7 @@ set(CMT_VERSION_MINOR 3) 58 set(CMT_VERSION_PATCH 5) 59 set(CMT_VERSION_STR "${CMT_VERSION_MAJOR}.${CMT_VERSION_MINOR}.${CMT_VERSION_PATCH}") 60 61-# Define __FILENAME__ consistently across Operating Systems 62-if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows") 63- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__='\"$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<))\"'") 64-else() 65- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__") 66-endif() 67+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__FILENAME__=__FILE__") 68 69 # Configuration options 70 option(CMT_DEV "Enable development mode" No) 71