summarylogtreecommitdiffstats
path: root/0007-cmake-install-tags.py-properly.patch
diff options
context:
space:
mode:
Diffstat (limited to '0007-cmake-install-tags.py-properly.patch')
-rw-r--r--0007-cmake-install-tags.py-properly.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/0007-cmake-install-tags.py-properly.patch b/0007-cmake-install-tags.py-properly.patch
new file mode 100644
index 000000000000..9c7ea1f35861
--- /dev/null
+++ b/0007-cmake-install-tags.py-properly.patch
@@ -0,0 +1,40 @@
+From 30c905970e06caf9bb4b8211d759d6107f863ca0 Mon Sep 17 00:00:00 2001
+From: Xiretza <xiretza@xiretza.xyz>
+Date: Sat, 4 Jun 2022 19:35:34 +0200
+Subject: [PATCH 7/7] cmake: install tags.py properly
+
+---
+ src/CMakeLists.txt | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 63502e5..8d3564f 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -76,13 +76,15 @@ antlr_target(FasmParser antlr/FasmParser.g4 PARSER VISITOR
+ # line 1: Skip lines starting in #define
+ # 2: Extract TAGS(...) from dependencies
+ # 3: Convert from TAGS('c', long_name) -> long_name = b'c, write to file
+-add_custom_target(tags.py ALL
++add_custom_command(OUTPUT tags.py
+ COMMAND grep -ve ^\#define ${CMAKE_CURRENT_SOURCE_DIR}/ParseFasm.cpp |
+ grep -hoe TAG\([^\)]*\) |
+- sed -e s/TAG\(\\\(.*\\\),\ \\\(.*\\\)\)/\\2\ =\ b\\1/ > tags.py
++ sed -e s/TAG\(\\\(.*\\\),\ \\\(.*\\\)\)/\\2\ =\ b\\1/ > ${CMAKE_CURRENT_BINARY_DIR}/tags.py
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/ParseFasm.cpp
+ VERBATIM
+ )
++add_custom_target(tags_py ALL DEPENDS tags.py)
++install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tags.py DESTINATION ${CMAKE_INSTALL_LIBDIR})
+
+ # Include generated files in project environment
+ include_directories(${ANTLR_FasmLexer_OUTPUT_DIR})
+@@ -120,5 +122,3 @@ include(CTest)
+ add_test(NAME parse_fasm_tests
+ COMMAND parse_fasm_tests)
+ enable_testing()
+-
+-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tags.py DESTINATION .)
+--
+2.36.1
+