diff options
author | Jose <jose@zeroc.com> | 2016-12-14 12:50:36 -0800 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2016-12-14 12:50:36 -0800 |
commit | fb077d24cdf649e9b2c0a89e1c36ba4420bb1158 (patch) | |
tree | c181d9803ece8fc82fb9c3748612b53667a0ed5a /cpp/src/Slice/Preprocessor.cpp | |
parent | ICE-7445 - Add libressl build support (diff) | |
download | ice-fb077d24cdf649e9b2c0a89e1c36ba4420bb1158.tar.bz2 ice-fb077d24cdf649e9b2c0a89e1c36ba4420bb1158.tar.xz ice-fb077d24cdf649e9b2c0a89e1c36ba4420bb1158.zip |
Fix for dependency parsing
MCPP can emit multiple file names in a single line that
is the case when the max line lenght is no exceeded. With
previous fixes to handle .ice in file paths that case was
not correctly handled.
Diffstat (limited to 'cpp/src/Slice/Preprocessor.cpp')
-rw-r--r-- | cpp/src/Slice/Preprocessor.cpp | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/cpp/src/Slice/Preprocessor.cpp b/cpp/src/Slice/Preprocessor.cpp index 74513f736fb..3adba67d753 100644 --- a/cpp/src/Slice/Preprocessor.cpp +++ b/cpp/src/Slice/Preprocessor.cpp @@ -368,12 +368,40 @@ Slice::Preprocessor::printMakefileDependencies(ostream& out, Language lang, cons // First remove the backslash used to escape new lines. // string::size_type pos; - while((pos = unprocessed.find("\\\n")) != string::npos) + while((pos = unprocessed.find(" \\\n")) != string::npos) { - unprocessed.replace(pos, 2, "\n"); + unprocessed.replace(pos, 3, "\n"); } // + // Split filenames in separate lines: + // + // /foo/A.ice /foo/B.ice becomes + // /foo/A.ice + // /foo/B.ice + // + // C:\foo\A.ice C:\foo\B.ice becomes + // C:\foo\A.ice + // C:\foo\B.ice + // + pos = 0; +#ifdef _WIN32 + while((pos = unprocessed.find(".ice ", pos)) != string::npos) + { + if(unprocessed.find(":", pos) == pos + 6) + { + unprocessed.replace(pos, 5, ".ice\n"); + pos += 5; + } + } +#else + while((pos = unprocessed.find(".ice /", pos)) != string::npos) + { + unprocessed.replace(pos, 5, ".ice\n"); + } +#endif + + // // Get the main output file name. // #ifdef _MSC_VER |