bfgroup / b2

B2 makes it easy to build C++ projects, everywhere.
https://www.bfgroup.xyz/b2/
Boost Software License 1.0
75 stars 228 forks source link

mingw: alter linker commands to always replace backslashes with forward slashes #361

Closed chris-se closed 5 months ago

chris-se commented 6 months ago

Proposed changes

gcc (mingw) is perfectly fine being invoked with Windows paths that contain backslashes as the directory separator, but this holds only true for arguments that are specified as part of the command line. If due to the Windows command line size limit b2 decides to use a response file, gcc will only accept forward slashes as the directory separator. The current linker rules in gcc.jam (link and link.dll) don't have the corresponding :T modifiers at the place of the linker targets. This change adds the missing ones.

This is similar to the fix in https://github.com/bfgroup/b2/issues/352, but for dynamic libraries and executables.

This actually the correct fix for https://github.com/bfgroup/b2/issues/342, because the ar fix didn't actually fix that case, due to that fix affecting a different rule. (That was still required in other cases.)

Types of changes

What types of changes does your code introduce?

Checklist