\; is an oddball artifact of the way CMake’s list representation was “designed”. It passes through rather than having a \ stripped off. Usually I just play around with escaping ; more and more until I get the result I want.
I’ve been playing with escape sequences for about 3 days now and went through a bunch of options. As a result, I cannot get the desired result. Also found these sources in which a similar problem was never properly resolved: 1, 2
This variable is a toolchain-level thing and applies to the entire C++ toolchain. As such, it is only used from the top-level scope and it applies to all such linker flags. The separator variable is the same way.
I noticed that when using Ninja, the handling of the "\\" escape sequence was.
Probably the way to solve my problem lies at the stage of passing the string containing the linker flags to the Ninja generator.
Hmm. Please file an issue with the expected command line as you would run it in a shell and how you’ve tried specifying it in CMake code to pass through. The results of each (especially those that are close) would be helpful. If it is per-generator behavior, differences there would also be helpful.
Sorry, quoting in CMake is problematic due to the stringly-typed language, but we try to work around the problem in various ways (such as LINKER: or SHELL:). A VERBATIM: might be warranted.