Closed oparisy closed 1 year ago
There is a discussion of very similar errors on https://github.com/godotengine/godot/issues/26046
Hmmm... I wonder if this is a "build type" vs. "multiconfig" issue.
For the CMake steps, could you please try:
$ cmake -B GDExtensionTemplate-build -G"Visual Studio 17 2022" -DCMAKE_INSTALL_PREFIX=GDExtensionTemplate-install GDExtensionTemplate
$ cmake --build GDExtensionTemplate-build --config Release
Sure! The first CMake step leads to the following error:
C:\Dev>cmake -B GDExtensionTemplate-build -G"Visual Studio 17 2022" -DCMAKE_INSTALL_PREFIX=GDExtensionTemplate-install GDExtensionTemplate
-- Using CMake 3.25.2
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22621.
-- The CXX compiler identification is MSVC 19.34.31937.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building GDExtensionTemplate for AMD64 on Windows
-- [GDExtensionTemplate] Treating warnings as errors
-- Using git: C:/Program Files/Git/cmd/git.exe (git version 2.39.1.windows.1)
-- GDExtensionTemplate version: godot-4.0-beta-17
-- Install directory: C:/Dev/GDExtensionTemplate-install/GDExtensionTemplate/
CMake Error at templates/CMakeLists.txt:15 (message):
CMAKE_BUILD_TYPE must be set to Debug or Release
-- Configuring incomplete, errors occurred!
See also "C:/Dev/GDExtensionTemplate-build/CMakeFiles/CMakeOutput.log".
😆 I put in that check because of this problem. Basically godot-cpp sets a bunch of options explicitly (👹) so we have no control over things and must try to match what it's doing rather than the other way around.
Next attempt:
cmake -B GDExtensionTemplate-build -G"Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=GDExtensionTemplate-install GDExtensionTemplate
cmake --build GDExtensionTemplate-build
Oh I was trying just that (adding the extra -DCMAKE_BUILD_TYPE=Release
) and yes, this time it works:
$ cmake -B GDExtensionTemplate-build -G"Visual Studio 17 2022" -DCMAKE_INSTALL_PREFIX=GDExtensionTemplate-install -DCMAKE_BUILD_TYPE=Release GDExtensionTemplate
$ cmake --build GDExtensionTemplate-build --config Release
Leads to:
(...)
Compiling...
utility_functions.cpp
object.cpp
object.cpp
godot-cpp.vcxproj -> C:\Dev\GDExtensionTemplate-build\extern\godot-cpp\bin\Release\godot-cpp.windows.release.64.lib
Building Custom Rule C:/Dev/GDExtensionTemplate/CMakeLists.txt
Example.cpp
GDExtensionTemplate.cpp
RegisterExtension.cpp
Creating library C:/Dev/GDExtensionTemplate-build/Release/GDExtensionTemplate.lib and object C:/Dev/GDExtensionTemplate-build/Releas
e/GDExtensionTemplate.exp
Generating code
Previous IPDB not found, fall back to full compilation.
All 2381 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
Finished generating code
GDExtensionTemplate.vcxproj -> C:\Dev\GDExtensionTemplate-build\GDExtensionTemplate\lib\Windows-AMD64\Release\GDExtensionTemplate.dll
Building Custom Rule C:/Dev/GDExtensionTemplate/CMakeLists.txt
👍 Thank you for the report and the testing.
I'll update the README.
I gave a try at compiling GDExtensionTemplate unmodified:
At that step I get errors of the form (multiple such lines, 2 per
.obj
):Concluded with:
My setup: Windows 11, CMake 3.25.2, Visual Studio Community 2022, Python 3.11.1. I did not install Ccache since Windows support seems spotty.