summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-11-08 06:36:01 +0100
committerPřemysl Eric Janouch <p@janouch.name>2021-11-08 06:36:01 +0100
commit6b871898d82c0b902a9766b2eeb5c1b682786080 (patch)
tree96df83af39c63b4bb9cc414101beed49fdde9412
parent4598c45d2f0279a2003fdab361685f8cba4eb38a (diff)
downloadnncmpp-6b871898d82c0b902a9766b2eeb5c1b682786080.tar.gz
nncmpp-6b871898d82c0b902a9766b2eeb5c1b682786080.tar.xz
nncmpp-6b871898d82c0b902a9766b2eeb5c1b682786080.zip
Fix build on macOS and other non-GNU systems
-rw-r--r--CMakeLists.txt10
1 files changed, 5 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 12bc35a..2e637cd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -94,13 +94,13 @@ include_directories (${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR})
set (actions ${PROJECT_BINARY_DIR}/nncmpp-actions.h)
add_custom_command (OUTPUT ${actions}
COMMAND cpp -I${PROJECT_BINARY_DIR} -P ${PROJECT_SOURCE_DIR}/nncmpp.actions
- | grep . | tr [[\n]] [[\t]] | sed -ne [[y/\t/\n/]] > ${actions}
- -e [[h; s/,[^\n]*/,/g]] -e [[s/$/COUNT/]]
- -e [[s/[^\n]*/\tACTION_&/g]] -e [[s/.*/enum action {\n&\n};\n/p]]
- -e [[g; s/,[^\n]*//g; y/_/-/]] -e [[s/[^\n]\{1,\}/\t"&",/g]]
+ | grep . | tr [[\n]] ^ | sed -ne [[h; s/,[^^]*/,/g]] -e [[s/$/COUNT/]]
+ -e [[s/[^^]*/\tACTION_&/g]] -e [[s/.*/enum action {\n&\n};\n/p]]
+ -e [[g; s/,[^^]*//g; y/_/-/]] -e [[s/[^^]\{1,\}/\t"&",/g]]
-e [[s/.*/static const char *g_action_names[] = {\n&};\n/p]]
- -e [[g; s/[^\n]*, //g;]] -e [[s/[^\n]\{1,\}/\t"&",/g]]
+ -e [[g; s/[^^]*, *//g;]] -e [[s/[^^]\{1,\}/\t"&",/g]]
-e [[s/.*/static const char *g_action_descriptions[] = {\n&};/p]]
+ | tr ^ [[\n]] > ${actions}
COMMAND test -s ${actions}
DEPENDS ${PROJECT_BINARY_DIR}/config.h VERBATIM)