Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erros if PCH option is enabled in cmake #11

Open
SaeidYazdani opened this issue Apr 24, 2020 · 0 comments
Open

Erros if PCH option is enabled in cmake #11

SaeidYazdani opened this issue Apr 24, 2020 · 0 comments

Comments

@SaeidYazdani
Copy link

SaeidYazdani commented Apr 24, 2020

If I enable the PCH options in cmake then building the project fails. Any idea how can I get rid of this error? I tried to look into cmake documentation and it looks like there should be a way to exclude the "test" folder from being a target for precompiled headers?

saya@sayavbox:~/Work/cpp_base_project/build$ make
[  6%] Building CXX object test/CMakeFiles/catch_main.dir/catch_main.cpp.o
error: file '/home/saya/Work/cpp_base_project/build/test/CMakeFiles/catch_main.dir/cmake_pch.hxx.gch' is not a valid precompiled PCH file [clang-diagnostic-error]
error: input is not a PCH file: '/home/saya/Work/cpp_base_project/build/test/CMakeFiles/catch_main.dir/cmake_pch.hxx.gch' [clang-diagnostic-error]
1 warning and 3 errors generated.
Error while processing /home/saya/Work/cpp_base_project/test/catch_main.cpp.
Suppressed 1 warnings (1 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
Found compiler error(s).
make[2]: *** [test/CMakeFiles/catch_main.dir/build.make:79: test/CMakeFiles/catch_main.dir/catch_main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:230: test/CMakeFiles/catch_main.dir/all] Error 2
make: *** [Makefile:95: all] Error 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant