File: generate_swq_parser.cmake

package info (click to toggle)
gdal 3.11.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 89,016 kB
  • sloc: cpp: 1,165,048; ansic: 208,864; python: 26,958; java: 5,972; xml: 4,611; sh: 3,776; cs: 2,508; yacc: 1,306; makefile: 213
file content (18 lines) | stat: -rw-r--r-- 561 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
message("Generating swq_parser.cpp")

if (NOT BISON_FOUND)
  message(FATAL_ERROR "Bison not found")
endif()

execute_process(COMMAND "${BISON_EXECUTABLE}" "--no-lines" "-d" "-p" "swq" "-oswq_parser.cpp" "swq_parser.y"
                RESULT_VARIABLE STATUS)

if(STATUS AND NOT STATUS EQUAL 0)
  message(FATAL_ERROR "bison failed")
endif()

# Post processing of the generated file
file(READ "swq_parser.cpp" CONTENTS)
# to please clang 15
string(REPLACE "++yynerrs;" "++yynerrs; (void)yynerrs;" CONTENTS "${CONTENTS}")
file(WRITE "swq_parser.cpp" "${CONTENTS}")