aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/wireshark/files/0002-flex-Remove-line-directives.patch
blob: 0e6249c9398bf9787139a125e80f6dca042b61ef (plain)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From e4e88c2f55286cf24af230b265d0e059363baa6c Mon Sep 17 00:00:00 2001
From: Oleksiy Obitotskyy <oobitots@cisco.com>
Date: Thu, 26 Nov 2020 12:00:43 -0800
Subject: [PATCH] flex: Remove #line directives

Append --noline option to flex to not
generate #line directives with absolute file patch.

Upstream-Status: Pending
Signed-off-by: Oleksiy Obitotskyy <oobitots@cisco.com>

---
 cmake/modules/FindLEX.cmake | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/cmake/modules/FindLEX.cmake b/cmake/modules/FindLEX.cmake
index 20caa09..174f452 100644
--- a/cmake/modules/FindLEX.cmake
+++ b/cmake/modules/FindLEX.cmake
@@ -32,11 +32,19 @@ MACRO(ADD_LEX_FILES _source _generated)
       SET(_outc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.c)
       SET(_outh ${CMAKE_CURRENT_BINARY_DIR}/${_basename}_lex.h)
 
-      ADD_CUSTOM_COMMAND(
-        OUTPUT ${_outc} ${_outh}
-        COMMAND ${LEX_EXECUTABLE} $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:--debug> -o${_outc} --header-file=${_outh} ${_in}
-        DEPENDS ${_in}
-      )
+      IF (DEFINED ENV{SOURCE_DATE_EPOCH})
+        ADD_CUSTOM_COMMAND(
+          OUTPUT ${_outc} ${_outh}
+          COMMAND ${LEX_EXECUTABLE} $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:--debug> --noline -o${_outc} --header-file=${_outh} ${_in}
+          DEPENDS ${_in}
+        )
+      ELSE ()
+        ADD_CUSTOM_COMMAND(
+          OUTPUT ${_outc} ${_outh}
+          COMMAND ${LEX_EXECUTABLE} $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:--debug> -o${_outc} --header-file=${_outh} ${_in}
+          DEPENDS ${_in}
+        )
+      ENDIF ()
       LIST(APPEND ${_source} ${_in})
       LIST(APPEND ${_generated} ${_outc})
       INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})