Giter VIP home page Giter VIP logo

Comments (22)

AmineKhaldi avatar AmineKhaldi commented on July 16, 2024

I tested the latest revision and the problem still occurs.

from cmakepchcompiler.

nanoant avatar nanoant commented on July 16, 2024

It should be fixed by acd3166

from cmakepchcompiler.

AmineKhaldi avatar AmineKhaldi commented on July 16, 2024

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.

from cmakepchcompiler.

nanoant avatar nanoant commented on July 16, 2024

Should be addressed by 9c6e030

And please wrap compiler output with markdowns ~~~ or ```. Thanks for testing :)

from cmakepchcompiler.

AmineKhaldi avatar AmineKhaldi commented on July 16, 2024

Nice! didn't know about this ;)

from cmakepchcompiler.

AmineKhaldi avatar AmineKhaldi commented on July 16, 2024

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.

from cmakepchcompiler.

nanoant avatar nanoant commented on July 16, 2024

Seems like some CMake bug (or fancy behavior), anyways applied a fix at 596f28e

from cmakepchcompiler.

AmineKhaldi avatar AmineKhaldi commented on July 16, 2024

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.

from cmakepchcompiler.

nanoant avatar nanoant commented on July 16, 2024

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.

from cmakepchcompiler.

AmineKhaldi avatar AmineKhaldi commented on July 16, 2024

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).

from cmakepchcompiler.

nanoant avatar nanoant commented on July 16, 2024

Okay I think I managed to solve it with 9f3102e

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

from cmakepchcompiler.

AmineKhaldi avatar AmineKhaldi commented on July 16, 2024

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)

from cmakepchcompiler.

nanoant avatar nanoant commented on July 16, 2024

Wrrr.... okay I made little mistake in property checking. Fixed in 8df5ad5. Please try again.

from cmakepchcompiler.

AmineKhaldi avatar AmineKhaldi commented on July 16, 2024

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.

from cmakepchcompiler.

nanoant avatar nanoant commented on July 16, 2024

Can you tell me which CMake version you are using?

from cmakepchcompiler.

AmineKhaldi avatar AmineKhaldi commented on July 16, 2024

cmake version 3.1

from cmakepchcompiler.

nanoant avatar nanoant commented on July 16, 2024

Okie, this seems like you fault as you are passing "NOTFOUND" target as parameter. I have added check a7ec70e that should make cmake fail with more reasonable message.

from cmakepchcompiler.

AmineKhaldi avatar AmineKhaldi commented on July 16, 2024

I'm doing:
target_precompiled_header(netshell precomp.h)
What NOTFOUND ?

Also the issue persists with the latest revision.

from cmakepchcompiler.

nanoant avatar nanoant commented on July 16, 2024

I am sorry, you are right, I was running last step hook unconditionally, now fixed with 3329f66

Please re-test.

from cmakepchcompiler.

AmineKhaldi avatar AmineKhaldi commented on July 16, 2024

The line became cmake/CMakePCHCompiler.cmake:228

from cmakepchcompiler.

paul-michalik avatar paul-michalik commented on July 16, 2024

I also ran into the same problem. Why is this issue marked as fixed?

from cmakepchcompiler.

m-7761 avatar m-7761 commented on July 16, 2024

Here is a fix for this problem in my case: #11

from cmakepchcompiler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.