cxong / cdogs-sdl

Classic overhead run-and-gun game
https://cxong.github.io/cdogs-sdl/
GNU General Public License v2.0
895 stars 115 forks source link

Remove set of cdogs_proto source files are genereated #738

Closed T6Zksor closed 2 years ago

T6Zksor commented 2 years ago

Hi,

When I was building cdogs-sdl I met an error, said

c1 : fatal error C1083: Cannot open source file: 'D:\repos\thirdparty\cdogs-sdl\builds\src\proto\nanopb\pb_encode.c': N
o such file or directory [D:\repos\thirdparty\cdogs-sdl\builds\src\proto\cdogs_proto.vcxproj]
c1 : fatal error C1083: Cannot open source file: 'D:\repos\thirdparty\cdogs-sdl\builds\src\proto\nanopb\pb_common.c': N
o such file or directory [D:\repos\thirdparty\cdogs-sdl\builds\src\proto\cdogs_proto.vcxproj]
c1 : fatal error C1083: Cannot open source file: 'D:\repos\thirdparty\cdogs-sdl\builds\src\proto\msg.pb.c': No such fil
e or directory [D:\repos\thirdparty\cdogs-sdl\builds\src\proto\cdogs_proto.vcxproj]
c1 : fatal error C1083: Cannot open source file: 'D:\repos\thirdparty\cdogs-sdl\builds\src\proto\nanopb\pb_decode.c': N
o such file or directory [D:\repos\thirdparty\cdogs-sdl\builds\src\proto\cdogs_proto.vcxproj]

So I check the script used to build the project, which is

if not exist "builds/" mkdir builds
cmake -B builds -S . -A Win32 -DCMAKE_TOOLCHAIN_FILE=D:/vcpkg/scripts/buildsystems/vcpkg.cmake

Finally find out the problem is I put everything CMake generated into builds direcotory, and cdogs_proto's CMakeLists.txt set all its source files are GENERATED, which makes final full paths are relative to builds directory.

https://github.com/Kitware/CMake/blob/b5b4ae17dcbc3ad813fca074478611afb1700232/Source/cmSourceFile.cxx#L123-L130

Seems cdogs_proto sources are not generated anymore, maybe set them as generated should be remove in CMakeLists.txt?

Build environment: