On 03/26/2014 02:45 PM, Jiri Malak wrote:
> For unix like system cmdl is reconstruct from argv by aproximation one
> space as separator between each item. Next is processed as characters stream.

Thanks, that is the explanation I needed.  Is that done on Windows too?

Here is an experiment in bash with spaces in the object file names:

$ for arg in file {'s 1.obj' 's 2.obj' 's 3.obj'} ; do echo "[$arg]"; done
[file]
[{s 1.obj]
[s 2.obj]
[s 3.obj}]

The wlink-reconstructed string will then be

 file {s 1.obj s 2.obj s 3.obj}

The shell consumed the single quotes so wlink will not see them.
This is what I meant in my "'/path with space/to/src.o'" example.
The two-layer quoting is needed to ensure wlink sees the single
quotes:

$ for arg in file {"'s 1.obj'" "'s 2.obj'" "'s 3.obj'"} ; do echo "[$arg]"; done
[file]
[{'s 1.obj']
['s 2.obj']
['s 3.obj'}]

The wlink-reconstructed string will then be

 file {'s 1.obj' 's 2.obj' 's 3.obj'}

and wlink will see the single quotes.

Therefore the proposed useSingleQuote API changes in CMake are not
correct.  Instead the object names themselves should each be
single-quoted before being sent through the normal double-quoting
for link command-line generation.

Does an invocation of wlink on Windows handle

 file {"'s 1.obj'" "'s 2.obj'" "'s 3.obj'"}

correctly when launched from a command prompt?

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to