You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Building the Godot-cpp Bindings via the provided SCons and CMake setups in Windows with MSVC result in .libs with different configurations or at least built with different compiler flags. The SCons version seems to always have the /MT flag set (for release and debug builds) and the CMake version the /MD flag for release builds and the /MDd flag for debug builds.
This results in compile errors like libgodot-cpp.windows.template_debug.x86_64.lib(error_macros.windows.template_debug.x86_64.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MDd_DynamicDebug' in gdexample.obj
when linking the bindings library built with SCons in debug with a GDExtension project that has not /MT explicitly set.
Since in the CMake file /MD and /MDd are explicitly set for release and debug builds respecivly, I assume this behaviour was not intended.
Other compilers or OSs were not tested regarding this issue.
Steps to reproduce
Follow the instructions to get and build the Godot-Bindings and the GDExtension example from the C++ tutorial.
When both the bindings and the example are built with SCons it compiles without problem.
When using a CMakeLists.txt in the root directory like
to build the example with, compile errors like the one shown above should appear. Also when using /MD, /MDd or /MTd flags.
When commenting in the /MT compiler flag, the errors are gone.
When building the binding with CMake (debug build; as per example in the CMakeLists.txt in the bindings repository)
cd godot-cpp
mkdir build
cd build
cmake build ..
cmake --build .
and linking the resulting library with the GDExtension example (e.g. commenting out the SCons-.lib and commenting in the CMake-.lib in my CMakeLists.txt example) the errors appear only if the /MT or /MTd flags are set.
This should show, that the bindings library configuration differs between the provided SCons and the CMake setups.
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered:
Godot version
N/A
godot-cpp version
4.2.2 stable
System information
Windows 10
Issue description
Building the Godot-cpp Bindings via the provided SCons and CMake setups in Windows with MSVC result in
.lib
s with different configurations or at least built with different compiler flags. The SCons version seems to always have the/MT
flag set (for release and debug builds) and the CMake version the/MD
flag for release builds and the/MDd
flag for debug builds.This results in compile errors like
libgodot-cpp.windows.template_debug.x86_64.lib(error_macros.windows.template_debug.x86_64.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MDd_DynamicDebug' in gdexample.obj
when linking the bindings library built with SCons in debug with a GDExtension project that has not
/MT
explicitly set.Since in the CMake file
/MD
and/MDd
are explicitly set for release and debug builds respecivly, I assume this behaviour was not intended.Other compilers or OSs were not tested regarding this issue.
Steps to reproduce
Follow the instructions to get and build the Godot-Bindings and the GDExtension example from the C++ tutorial.
When both the bindings and the example are built with SCons it compiles without problem.
When using a
CMakeLists.txt
in the root directory liketo build the example with, compile errors like the one shown above should appear. Also when using
/MD
,/MDd
or/MTd
flags.When commenting in the
/MT
compiler flag, the errors are gone.When building the binding with CMake (debug build; as per example in the
CMakeLists.txt
in the bindings repository)and linking the resulting library with the GDExtension example (e.g. commenting out the SCons-
.lib
and commenting in the CMake-.lib
in myCMakeLists.txt
example) the errors appear only if the/MT
or/MTd
flags are set.This should show, that the bindings library configuration differs between the provided SCons and the CMake setups.
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: