Open justofisker opened 1 year ago
I have a PR for modernising the cmake build scripts that I believe would resolve this issue.
The test project becomes a target of the main project and doesn't need to be configured separately.
Also for visual studio is a multi-config generator which means passing in CMAKE_BUILD_TYPE
at the configure stage is ignored by visual studio always setting the config to the default which is Debug. The build configuration needs to be passed at the build command like so cmake --build . --config Release
. With the current master both the config stage and build stage require to set the config type. but if my PR gets merged, then its only required at the build command for visual studio.
Issue description
When attempting to build the test project for this using CMake it fails do to looking for the godot-cpp library file
Output when attempting to build test project using VSCode's CMake extension:
My workaround
The current way I am working around this is adding "lib" to the beginning of this filename
https://github.com/godotengine/godot-cpp/blob/f1d501f97749fd70f590a3e82b81e55d6cf1d2d7/test/CMakeLists.txt#L138
and changing
https://github.com/godotengine/godot-cpp/blob/f1d501f97749fd70f590a3e82b81e55d6cf1d2d7/test/CMakeLists.txt#L112-L121
to
Issues with my workaround
There are two problems with this second change. Firstly, for non x86 platforms the
x86_
prefix in not valid. Secondly, while the only release binary build type istemplate_release
, bothtemplate_debug
andeditor
are valid build types for a debug builds and can both be used by the editor if linked against, but this change only checks fortemplate_debug
.