Difference between gpj file generation on windows and Linux machine
Using CMake 3.7 on Windows 7 and Ubuntu 18.04. with GHS MULTI Generator. Debug tools on Windows 7: Visual Studio 2017 and Qt Creator 4.2.0/Based on Qt 5.7.1(MSVC 2015,32 bit) Debug tools on Linux: Qt Creator 4.5.2/Based on Qt 5.9.5(GCC 7.3.0 64 bit)
Hello I'm working on project, where is using CMAKE to generate gpj files on Windows and Linux machine. I found out, that gpj files are filling in different order on both machines. For example: On Windows machine: -AAA [Program] -BBB [Program] -CCC [Program] -DDD [INTEGRITY Application] -EEE [Program] -FFF [Program] -III [Program] -JJJ [Program] -KKK [Library] -LLL [Library] -MMM [Library]
On Linux machine: -AAA [Program] -BBB [Program] -CCC [Program] -DDD [Program] -KKK [Library] -GGG [Program] -DDD [INTEGRITY Application] -LLL[Library] -FFF [Program] -MMM [Program] -HHH [Program] -KKK [Program]
In follow example you can see order on windows machine is quite different than Linux machine and for example [INTEGRITY Application] is on 4-position on Win and 7-th position on Linux. After debugging CMAKE on my project, I found out in file cmMakefile.cxx in function AddNewTarget is fill all Targets:
cmTarget* cmMakefile::AddNewTarget(cmState::TargetType type, const std::string& name) { cmTargets::iterator it = this->Targets .insert(cmTargets::value_type( name, cmTarget(name, type, cmTarget::VisibilityNormal, this))) .first; this->GetGlobalGenerator()->IndexTarget(&it->second); this->GetStateSnapshot().GetDirectory().AddNormalTargetName(name); return &it->second; }
The ordering of files is done by function insert, which for different mashine call different file. On Window machine is calling xhash file(C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include), where the targets are place in correct order FIFO(first in , first out into gpj file) On Linux machine is calling move.h (/usr/include/c++/7/bits/move.h),where the targets are place in random order. I am expecting targets ordering on Linux to exact as Windows.
Do you have any suggestion or advice how to make window and Linux file alignment in gpj file to be a same?
Don't hesitate to contact, if you want any additional information or unclear points. Thanks in advance.