[cmake-developers] wlink command-line parsing (was: remove CMAKE_NO_QUOTED_OBJECTS variable)

Jiri Malak malak.jiri at gmail.com
Wed Mar 26 13:59:24 EDT 2014


I understand it is a little confusing, but watcom linker have one cmdl syntax for all supported
platforms. It is reason for not use double quote any way and use single quote. Linker has own cmdl
parser which process cmdl for Windows, Linux, etc as stream.This method is used for procesing all
inputs as response files, environment variable, system scripts etc.

Jiri

> On 03/26/2014 01:29 PM, Jiri Malak wrote:
>> No, you must use only single quotes, because linker has its own command line token parser and
>> for
>> file names in file directive with curl braces space is list separator.
>> Double quotes can be used with file directive without curl braces then list separator is comma.
>
> I've updated the commit message as requested:
>
>  cmLocalUnixMakefileGenerator3: Re-organize ConvertToQuotedOutputPath
>  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e98772f2
>
>  Makefile: Generate single-quoted object lists for Watcom
>  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=13182cd6
>
> I still do not understand how wlink is parsing the command line on
> non-Windows platforms.  Currently the Watcom build rules specify:
>
>  file {<OBJECTS>}
>
> which becomes perhaps
>
>  file {'src1.obj' 'src2.obj' 'src3.obj'}
>
> This works on Windows because that operating system launches processes
> with command-line strings.  The main(argc,argv) are populated by the
> C runtime as explained here:
>
>  http://msdn.microsoft.com/en-us/library/a1y7w461.aspx
>
> However, programs have the option to use GetCommandLine:
>
>  http://msdn.microsoft.com/en-us/library/windows/desktop/ms683156%28v=vs.85%29.aspx
>
> to get the original command-line string for the process and do their
> own parsing.  The wlink tool must be doing this in order to parse the
> above {} and '' syntax.  However, on POSIX platforms the *shell*
> parses the command-line string according to its own rules and the
> OS-launched process gets only main(argc,argv) already separated into
> multiple arguments.  In the above example the process will get:
>
>  file
>  {src1.obj
>  src2.obj
>  src3.obj}
>
> as four separate arguments.  How does the wlink command-line work?
>
> Please provide an example command line invocation for wlink on Linux
> passing multiple objects with spaces in the path.
>
> Thanks,
> -Brad
>
>





More information about the cmake-developers mailing list