swig / cccl

Unix cc compiler to Microsoft's cl compiler wrapper
GNU General Public License v3.0
123 stars 36 forks source link

Pass through -Wl and don't change / to - #4

Closed isuruf closed 5 years ago

wsfulton commented 5 years ago

From our docs...

cccl is a wrapper around Microsoft's cl.exe Visual C++ compiler. It converts tradional Unix cc command line parameters to their cl.exe equivalents.

The majority of the changes here are a deviation from this and are focused on supporting a different compiler (cl-clang.exe instead of cl.exe). Various parts of the documentation will need updating to reflect this. Maybe some versions of cl.exe will accept '-' instead of '/' now, but I won't accept a change that uses dash as the output slash by default. A new cccl option to support cl-clang.exe instead of cl.exe by using dash instead of the slash in the output should be a simple way forward and I'd welcome a change along these lines.

We should leave the slash variable named slash.

I'm happy to take the -rpath and -Wl* changes. These aren't in standalone commits though, so I won't try and cherry pick them, so please put in separate out this into a separate pull request. The -rpath option also needs documenting like for example -mno-cygwin.

isuruf commented 5 years ago

The majority of the changes here are a deviation from this and are focused on supporting a different compiler (cl-clang.exe instead of cl.exe). Various parts of the documentation will need updating to reflect this. Maybe some versions of cl.exe will accept '-' instead of '/' now, but I won't accept a change that uses dash as the output slash by default.

/ change also affects cl.exe though. For example, autotools will link using the full path in some projects. If they are unixy paths, then there's a problem. How should cccl handle a call like cccl /c/asd.lib?

wsfulton commented 5 years ago

Paths passed to native Windows programs are handled differently according to the environment being run in. If I recall correctly mingw will translate these automatically and Cygwin requires cygpath to be used for all native Windows tools. In practice, I've found using mixed paths the best, so c:/asd.lib.

wsfulton commented 5 years ago

Superceded by #5 and #6.