Building from source with 4.18 release branch while cross compiling from windows, to linux, with clang-5.0.0 toolchain fails with many errors for -Wnonportable-include-path -Werror.
However, the fix did not make it across the build chain for all other toolchains with utilize clang as the compiler. This patch should be applied across all clang-using platforms.
It seems like the above mentioned commit didn’t actually fix the issue for Linux - I had to directly patch UnrealBuildTool and add the warning flag there.
The proper fix is to make sure that the case sensitivity of the file path is correct. E.g. if a file is called “Baz/Foobar.h” it should be included as “Baz/Foobar.h” but not “baz/foobar.h” or anyhow else.
While the cross-compilation will succeed on Windows with the warning disabled, issues like that will break native compilation on a case-sensitive file system, which may be needed at some point (e.g. for better debugging experience).
Linux by default uses a case sensitive file-systems and the code would not compile correctly on Linux and is therefore expected functionality (and not a bug). As macOS uses a case insensitive filesystem (by default) the macOS toolchain can get away with this hack. However this should not be fixed in the same way for the Linux buildchain.
Feel free to use the commit if you only intend to cross-compile to Linux but to fix this correctly you need to make sure that the file paths in the include directives match the actual path names on disk.
For example if you had a file named SomeFileName.h then you should reference it using: