Building Google Test and Google Mock from Source with Premake5 #4580
-
Hello everyone, I am attempting to build Background on builder choice: IssueI am currently running into an error where my generated makefile script is finding the following error:
This error feels weird because it makes it seem like I should add I have GoogleTest project forked and linked as a submodule to my project, so I have everything that is on the master branch. Is this a mistake in the source code to include source code rather than the headers? Additional InformationI am using VSCode with GCC 14 (C++23). Edit 1 (From my own comment below)https://cplusplus.com/forum/general/39618/ Generally, it seems to be looked down upon to include source files due to compilation and linking ending up including the file twice... Edit 2 (From my second comment)Looking at your CMakeLists.txt file, it does appear that you are including source files as if they were header files...
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
哥们我也遇到了和你的一样的错误,我采用的方法是写全路径,完美解决了 |
Beta Was this translation helpful? Give feedback.
I configured my
premake5.lua
file to handle the files similar to theirCMakeLists.txt
. So I am excluding all source files from building and linking, except,g{lib}_main.cpp
andg{lib}-all.cpp
. I then added the root folder to my includes{dirs...}/google{lib}
as well as the include folder:{dirs...}/google{lib}/include
and I was able to build the source with this configuration.Note:
{lib}
so I don't need to writetest
andmock
above.