blob: 824761a3dc1632608fbf9360b817d03b94381f90 (
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
From 42abf1d299fed8e00a189f6f9c55fb344e5bb775 Mon Sep 17 00:00:00 2001
From: Oleksiy Obitotskyy <oobitots@cisco.com>
Date: Wed, 27 Jan 2021 04:01:34 -0800
Subject: [PATCH] bison: Remove #line directives
Append --no-lines option to bison to not
generate #line directives with absolute file path.
Upstream-Status: Pending
Signed-off-by: Oleksiy Obitotskyy <oobitots@cisco.com>
---
cmake/modules/FindYACC.cmake | 31 ++++++++++++++++++++++---------
1 file changed, 22 insertions(+), 9 deletions(-)
diff --git a/cmake/modules/FindYACC.cmake b/cmake/modules/FindYACC.cmake
index c96f87b..54a73cb 100644
--- a/cmake/modules/FindYACC.cmake
+++ b/cmake/modules/FindYACC.cmake
@@ -29,15 +29,28 @@ MACRO(ADD_YACC_FILES _source _generated)
SET(_out ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.c)
- ADD_CUSTOM_COMMAND(
- OUTPUT ${_out}
- COMMAND ${YACC_EXECUTABLE}
- -d
- -p ${_basename}
- -o${_out}
- ${_in}
- DEPENDS ${_in}
- )
+ IF (DEFINED ENV{SOURCE_DATE_EPOCH})
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${_out}
+ COMMAND ${YACC_EXECUTABLE}
+ --no-lines
+ -d
+ -p ${_basename}
+ -o${_out}
+ ${_in}
+ DEPENDS ${_in}
+ )
+ ELSE ()
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${_out}
+ COMMAND ${YACC_EXECUTABLE}
+ -d
+ -p ${_basename}
+ -o${_out}
+ ${_in}
+ DEPENDS ${_in}
+ )
+ ENDIF ()
LIST(APPEND ${_source} ${_in})
LIST(APPEND ${_generated} ${_out})
ENDFOREACH (_current_FILE)
--
2.26.2.Cisco
|