Skip to content

Commit e2bd77d

Browse files
committed
Add Bison -l option based on the build type
For release-alike build types, `#line` directives should be removed with the `-l` option. Currently, FindBISON CMake module produces command with limited generator expression capabilities, so a workaround is added.
1 parent 4fe71b6 commit e2bd77d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cmake/cmake/Requirements.cmake

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,12 @@ if(
7272
TYPE REQUIRED
7373
PURPOSE "Necessary to generate PHP parser files."
7474
)
75-
# TODO: Add Bison options based on the build type.
75+
# Add Bison options based on the build type.
76+
set(PHP_DEFAULT_BISON_FLAGS "$<IF:$<CONFIG:Release,MinSizeRel>,-l$<SEMICOLON>-Wall,-Wall>")
77+
# Nicer way would be this, but GNU Bison errors out because it cannot process
78+
# empty double quoted arguments in the command-line.
79+
# See: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9921
7680
#set(PHP_DEFAULT_BISON_FLAGS "-Wall $<$<CONFIG:Release,MinSizeRel>:-l>")
77-
set(PHP_DEFAULT_BISON_FLAGS "-Wall")
7881
endif()
7982

8083
# Check if re2c is required.

0 commit comments

Comments
 (0)