On Mon 12 Jul 2021 at 00:50:38 -0000, [email protected] wrote:
> Merge authors:
>   Matthew Fuller (fullermd)
> ------------------------------------------------------------
> revno: 686 [merge]
> committer: Matthew Fuller <[email protected]>
> branch nick: ctwm
> timestamp: Sun 2021-07-11 19:49:19 -0500
> message:
>   Update minimum cmake version to 3.6.

This change may have broken with the cmake version that I'm using.

$ cmake --version
cmake version 3.20.4

$ make VERBOSE=1
...
[  4%] Built target man
make  -f CMakeFiles/ctwmlib.dir/build.make CMakeFiles/ctwmlib.dir/depend
[  5%] Building parser with yacc.
/usr/bin/yacc -d\ -b\ gram /mnt/vol1/rhialto/cvs/other/ctwm/bzr/trunk/gram.y
Usage: /usr/bin/yacc [options] filename

Options:
  -b file_prefix        set filename prefix (default "y.")
  -B                    create a backtracking parser
  -d                    write definitions (.tab.h)
  -i                    write interface (y.tab.i)
  -g                    write a graphical description
  -l                    suppress #line directives
  -L                    enable position processing, e.g., "%locations"
  -o output_file        (default ".tab.c")
  -p symbol_prefix      set symbol prefix (default "yy")
  -P                    create a reentrant parser, e.g., "%pure-parser"
  -r                    produce separate code and table files (y.code.c)
  -s                    suppress #define's for quoted names in %token lines
  -t                    add debugging support
  -v                    write description (y.output)
  -V                    show version information and exit
*** Error code 1

Stop.

Note the extra backslashes in "/usr/bin/yacc -d\ -b\ gram".

I think this comes from cmake_files/setup_yacc.cmake, which has 

set(YFLAGS "-d -b gram")

I suppose that cmake thinks that this string is meant as a single
argument and therefore it escapes the spaces to make it so.

Looking at the documentation at
https://cmake.org/cmake/help/latest/command/set.html doesn't mention
anything related to this though.

Some other cases of set() use the value unquoted (which seems like a
weird and unsafe syntax to me though) and removing the quotes here seems
to help.

The next yacc flag manipulation is more problematic:

    string(APPEND YFLAGS " -t -v")

With the quotes I get more backslashed spaces. Without them all spaces
disappear and everything gets stuck together, which is also wrong.

[  5%] Building parser with yacc.
/usr/bin/yacc -d -b gram-t-v /mnt/vol1/rhialto/cvs/other/ctwm/bzr/trunk/gram.y

So how to solve this one, I'm not sure yet.

-Olaf.
-- 
___ "Buying carbon credits is a bit like a serial killer paying someone else to
\X/  have kids to make his activity cost neutral." -The BOFH    falu.nl@rhialto

Attachment: signature.asc
Description: PGP signature

Reply via email to