Details
Description
Suppose we have common system library, like boost.
We have configured it with custom defines (a lot of) and then we place these defines in Export section of boost.
Then, we create dozens of small non-linked libraries, depended on boost.
We simply add Depends
, getting includePaths and defines. All ok.
Finally, we create An application, depending on all of these libs. As they use boost in includes, they export boost too. So we have dozen of duplicated boost's defines (it's not a joke... 8 defines and 12 duplications =~ 100 arguments on command line).
I created simple application to illustrate the problem.
Just compile it in qt creator until it stops on compilation error. On command line:
E:\SOFT\MSVC2010\VC\BIN/cl.exe /nologo /c /EHsc /Zi /MDd /IE:\prj2010\test1\boost_emul /IE:\prj2010\test1\lib1 /IE:\prj2010\test1\lib2 /IE:\prj2010\test1\boost_emul /DUNICODE /D_UNICODE /DBOOST_ENABLE_SOME /DBOOST_DISABLE_SOME /DLIB_DEF /DLIB_DEF /DBOOST_ENABLE_SOME /DBOOST_DISABLE_SOME "/DWINVER=0x500" "/D_WIN32_WINNT=0x500" "/D_WIN32_WINDOWS=0x500" /FoE:\prj2010\test1\qtc_Qt4_MSVC_dd58c174-debug\app1.qtc-Qt4-MSVC-dd58c174.7f1394cb\.obj\171ee6b10b19657f\app.cpp.obj E:\prj2010\test1\app1\app.cpp /TP
E:\prj2010\test1\app1\app.cpp(8) : error C2065: 'compilation_error' : undeclared identifier
defines and includes are duplicated.
p.s.
I ran into this when I had commandline-lenth issue on my linux box.
Just for now i workarounded it with some Depends moving - from Export section to end application. It helps, but not at all.