Details
-
Bug
-
Resolution: Won't Do
-
Not Evaluated
-
None
-
5.12.2
-
None
Description
The help text of the tool claims:
You can also use a colon ( : ) to separate the header name from the source file name, as in '-a filename_p.h:filename.cpp'
If an absolute path is given for the output header and source files on Windows, the tool does not generate the header file.
Specifically, because Windows paths usually contain a colon ( C:\foo\bar.h ), the tool splits the command line argument on the first colon, and incorrectly assumes which are the file paths.
Relevant code piece.
// produce a header name from the file name static QString header(const QString &name) { QStringList parts = name.split(QLatin1Char(':')); QString retval = parts.first(); if (retval.isEmpty() || retval == QLatin1String("-")) return retval; if (!retval.endsWith(QLatin1String(".h")) && !retval.endsWith(QLatin1String(".cpp")) && !retval.endsWith(QLatin1String(".cc"))) retval.append(QLatin1String(".h")); return retval; }
Not sure if we should / could replace the colon with something else (a semicolon perhaps), or we should try to handle windows paths with some heuristics.
This was uncovered as part of the Qt CMake port.