Closed AmineKhaldi closed 9 years ago
I tested the latest revision and the problem still occurs.
It should be fixed by acd3166fa78bb6495f4f3a52000340ac10696d04
Now it's:
FAILED: E:\RosBE\i386\bin\g++.exe -DDBG=1 -DKDBG=1 -DUSE_COMPILER_EXCEPTIONS -DWINVER=0x502 -D_DLL -D_M_IX86 -D_NETSHELL_ -D_SEH_ENABLE_TRACE -D_SETUPAPI_VER=0x502 -D_USE_32BIT_TIME_T -D_USE_PSEH3=1 -D_WIN32_IE=0x600 -D_WIN32_WINDOWS=0x502 -D_WIN32_WINNT=0x600 -D_X86_ -D__REACTOS__ -D__USE_CRTIMP -D__i386__ -D_inline=__inline -Di386 -Dnetshell_EXPORTS -pipe -fms-extensions -fno-strict-aliasing -mstackrealign -fno-rtti -fno-exceptions -fdebug-prefix-map="e:\reactos-vanilla"=ReactOS -gdwarf-2 -gstrict-dwarf -femit-struct-debug-detailed=none -feliminate-unused-debug-symbols -march=pentium -mtune=i686 -Werror -Wall -Wpointer-arith -Wno-char-subscripts -Wno-multichar -Wno-unused-value -Wno-maybe-uninitialized -Wno-error=unused-but-set-variable -Wno-error=type-limits -O1 -fno-optimize-sibling-calls -fno-omit-frame-pointer -mpreferred-stack-boundary=3 -fno-set-stack-executable -Winvalid-pch -Werror=invalid-pch -std=c++11 -g -Idll/shellext/netshell -Ie:/reactos-vanilla/dll/shellext/netshell -Ie:/reactos-vanilla/include -Ie:/reactos-vanilla/include/psdk -Ie:/reactos-vanilla/include/dxsdk -Iinclude -Iinclude/psdk -Iinclude/dxsdk -Iinclude/reactos -Ie:/reactos-vanilla/include/crt -Ie:/reactos-vanilla/include/ddk -Ie:/reactos-vanilla/include/ndk -Ie:/reactos-vanilla/include/reactos -Ie:/reactos-vanilla/include/reactos/libs -include E:/testing_new_pch/reactos/CMakeFiles/netshell.pch.dir/precomp.h -MMD -MT dll/shellext/netshell/CMakeFiles/netshell.dir/lanconnectui.cpp.obj -MF dll/shellext/netshell/CMakeFiles/netshell.dir/lanconnectui.cpp.obj.d -o dll/shellext/netshell/CMakeFiles/netshell.dir/lanconnectui.cpp.obj -c e:/reactos-vanilla/dll/shellext/netshell/lanconnectui.cpp
cc1plus.exe: fatal error: E:/testing_new_pch/reactos/CMakeFiles/netshell.pch.dir/precomp.h: No such file or directory
compilation terminated.
The "-include" should pass something like E:/testing_new_pch/reactos/dll/shellext/netshell/CMakeFiles/netshell.pch.dir/precomp.h instead of E:/testing_new_pch/reactos/CMakeFiles/netshell.pch.dir/precomp.h.
Should be addressed by 9c6e030155656a648f1c7351961153f66d076e5d
And please wrap compiler output with markdowns ~~~
or ```. Thanks for testing :)
Nice! didn't know about this ;)
Now we get:
build dll/shellext/netshell/CMakeFiles/netshell.dir/precomp.h.gch: CXXPCH_COMPILER e$:/reactos-vanilla/dll/shellext/netshell/precomp.h || cmake_order_depends_target_netshell
DEFINES = -DDBG=1 -DKDBG=1 -DUSE_COMPILER_EXCEPTIONS -DWINVER=0x502 -D_DLL -D_M_IX86 -D_NETSHELL_ -D_SEH_ENABLE_TRACE -D_SETUPAPI_VER=0x502 -D_USE_32BIT_TIME_T -D_USE_PSEH3=1 -D_WIN32_IE=0x600 -D_WIN32_WINDOWS=0x502 -D_WIN32_WINNT=0x600 -D_X86_ -D__REACTOS__ -D__USE_CRTIMP -D__i386__ -D_inline=__inline -Di386 -Dnetshell_EXPORTS
DEP_FILE = dll/shellext/netshell/CMakeFiles/netshell.dir/precomp.h.gch.d
FLAGS = -pipe -fms-extensions -fno-strict-aliasing -mstackrealign -fno-rtti -fno-exceptions -fdebug-prefix-map="e:
eactos-vanilla"=ReactOS -gdwarf-2 -gstrict-dwarf -femit-struct-debug-detailed=none -feliminate-unused-debug-symbols -march=pentium -mtune=i686 -Werror -Wall -Wpointer-arith -Wno-char-subscripts -Wno-multichar -Wno-unused-value -Wno-maybe-uninitialized -Wno-error=unused-but-set-variable -Wno-error=type-limits -O1 -fno-optimize-sibling-calls -fno-omit-frame-pointer -mpreferred-stack-boundary=3 -fno-set-stack-executable -Winvalid-pch -Werror=invalid-pch -std=c++11 -g -Idll/shellext/netshell -Ie:/reactos-vanilla/dll/shellext/netshell -Ie:/reactos-vanilla/include -Ie:/reactos-vanilla/include/psdk -Ie:/reactos-vanilla/include/dxsdk -Iinclude -Iinclude/psdk -Iinclude/dxsdk -Iinclude/reactos -Ie:/reactos-vanilla/include/crt -Ie:/reactos-vanilla/include/ddk -Ie:/reactos-vanilla/include/ndk -Ie:/reactos-vanilla/include/reactos -Ie:/reactos-vanilla/include/reactos/libs -include E:/testing_new_pch/reactos/dll/shellext/netshell/CMakeFiles/netshell.pch.dir/precomp.h -x c++-header
Notice that it's two lines instead of one, because
-fdebug-prefix-map="e:\reactos-vanilla"=ReactOS
In normal source files rules, is in this PCH case:
-fdebug-prefix-map="e:
eactos-vanilla"=ReactOS
Meaning the \r wasn't escaped properly and led to a new line.
Seems like some CMake bug (or fancy behavior), anyways applied a fix at 596f28e6e27ebe5c3eb1c9e50f90a905abbca9f1
Now:
FAILED: E:\RosBE\i386\bin\g++.exe -DDBG=1 -DKDBG=1 -DUSE_COMPILER_EXCEPTIONS -DWINVER=0x502 -D_DLL -D_M_IX86 -D_NETSHELL_ -D_SEH_ENABLE_TRACE -D_SETUPAPI_VER=0x502 -D_USE_32BIT_TIME_T -D_USE_PSEH3=1 -D_WIN32_IE=0x600 -D_WIN32_WINDOWS=0x502 -D_WIN32_WINNT=0x600 -D_X86_ -D__REACTOS__ -D__USE_CRTIMP -D__i386__ -D_inline=__inline -Di386 -Dnetshell_EXPORTS -pipe -fms-extensions -fno-strict-aliasing -mstackrealign -fno-rtti -fno-exceptions -fdebug-prefix-map="e:\reactos-vanilla"=ReactOS -gdwarf-2 -gstrict-dwarf -femit-struct-debug-detailed=none -feliminate-unused-debug-symbols -march=pentium -mtune=i686 -Werror -Wall -Wpointer-arith -Wno-char-subscripts -Wno-multichar -Wno-unused-value -Wno-maybe-uninitialized -Wno-error=unused-but-set-variable -Wno-error=type-limits -O1 -fno-optimize-sibling-calls -fno-omit-frame-pointer -mpreferred-stack-boundary=3 -fno-set-stack-executable -Winvalid-pch -Werror=invalid-pch -std=c++11 -g -Idll/shellext/netshell -Ie:/reactos-vanilla/dll/shellext/netshell -Ie:/reactos-vanilla/include -Ie:/reactos-vanilla/include/psdk -Ie:/reactos-vanilla/include/dxsdk -Iinclude -Iinclude/psdk -Iinclude/dxsdk -Iinclude/reactos -Ie:/reactos-vanilla/include/crt -Ie:/reactos-vanilla/include/ddk -Ie:/reactos-vanilla/include/ndk -Ie:/reactos-vanilla/include/reactos -Ie:/reactos-vanilla/include/reactos/libs -include E:/testing_new_pch/reactos/dll/shellext/netshell/CMakeFiles/netshell.pch.dir/precomp.h -MMD -MT dll/shellext/netshell/CMakeFiles/netshell.dir/netshell.cpp.obj -MF dll/shellext/netshell/CMakeFiles/netshell.dir/netshell.cpp.obj.d -o dll/shellext/netshell/CMakeFiles/netshell.dir/netshell.cpp.obj -c e:/reactos-vanilla/dll/shellext/netshell/netshell.cpp
cc1plus.exe: error: E:/testing_new_pch/reactos/dll/shellext/netshell/CMakeFiles/netshell.pch.dir/precomp.h.gch: not used because `_DLL' is defined [-Werror=invalid-pch]
cc1plus.exe: error: one or more PCH files were found, but they were invalid
cc1plus.exe: fatal error: E:/testing_new_pch/reactos/dll/shellext/netshell/CMakeFiles/netshell.pch.dir/precomp.h: No such file or directory
cc1plus.exe: all warnings being treated as errors
compilation terminated.
ninja: build stopped: subcommand failed.
It seems like you're missing the addition of target COMPILE_DEFINITIONS property? because that's where we add _DLL and __USE_CRTIMP in some specific cases.
Well, I know the reason of this one. PCH is simply in different target suffixed with .pch
and it does not inherit COMPILE_DEFINITIONS
property from its originating main target.
I cannot either put pch in the main target, since then it will try to link damn pch
file, and there is no way to prevent that.
So I need to think of it more. Maybe tomorrow I find some solution.
Hmm, can't you simply use the target name that we input to target_precompiled_header() in order to get this property from this target, and apply it to the pch target?
This target idea btw means in ReactOS for example there will be extra 900+ targets. Is there a better way? The current PCH solution (from Peter) doesn't involve any additional targets, only two properties added to CMake (code).
Okay I think I managed to solve it with 9f3102e5924449d14231b4463262459c9a10d0f6
Let me know how it works for you now.
Hmm, can't you simply use the target name that we input to target_precompiled_header() in order to get this property from this target, and apply it to the pch target?
See: https://github.com/nanoant/CMakePCHCompiler#how-does-it-work
Now:
CMake Error at cmake/CMakePCHCompiler.cmake:224 (set_target_properties):
set_target_properties called with incorrect number of arguments.
Call Stack (most recent call first):
Some weird path:9999 (__watch_pch_last_hook)
Wrrr.... okay I made little mistake in property checking. Fixed in 8df5ad56a87401ddf26d6f688be2511eaae86877. Please try again.
Tons and tons of
CMake Warning (dev) at cmake/CMakePCHCompiler.cmake:217 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
get_target_property() called with non-existent target "NOTFOUND".
Call Stack (most recent call first):
Some weird path:9999 (__watch_pch_last_hook)
This warning is for project developers. Use -Wno-dev to suppress it.
Can you tell me which CMake version you are using?
cmake version 3.1
Okie, this seems like you fault as you are passing "NOTFOUND"
target as parameter. I have added check a7ec70e94d0be5d9d9e5d0bebae6dcae13d61745 that should make cmake fail with more reasonable message.
I'm doing: target_precompiled_header(netshell precomp.h) What NOTFOUND ?
Also the issue persists with the latest revision.
I am sorry, you are right, I was running last step hook unconditionally, now fixed with 3329f661c2c8b822c67fcac969847e7d49fc2008
Please re-test.
The line became cmake/CMakePCHCompiler.cmake:228
I also ran into the same problem. Why is this issue marked as fixed?
Here is a fix for this problem in my case: https://github.com/nanoant/CMakePCHCompiler/pull/11
I tried this with a C++ module in ReactOS, but got:
Notice that header folders are not prefixed with -I for inclusions.