godotengine / godot-cpp

C++ bindings for the Godot script API
MIT License
1.74k stars 576 forks source link

Possible bug with CMake and visual studio release type #1582

Closed enetheru closed 1 month ago

enetheru commented 2 months ago

Godot version

-

godot-cpp version

master

System information

github ci

Issue description

I pulled the build logs from the github ci, 🏁 Build (Windows, MSVC, CMake) cmake command is 'cmake -DCMAKE_BUILD_TYPE=Release -G"Visual Studio 16 2019" .' but the visual studio build command has this in it: '/p:Configuration=Debug' is this a bug? I'm unfamilar with msvc I'm submitting this so that it doesnt get lost, and can be reviewed by someone familiar with msvc

Steps to reproduce

review the ci logs

Minimal reproduction project

Release build of godot-cpp using CMake and Visual Studio

enetheru commented 1 month ago

I found the answer

Visual Studio projects are multi-config projects like Ninja-MultiConfig which means you can't set the configuration at configure time as there are multiple, it always chooses the first one by default when not specified in the build command.

# Instead of this:
cmake -DCMAKE_BUILD_TYPE=Release -G"Visual Studio 17 2022" .
cmake --build . --verbose
# It should be this
cmake -G"Visual Studio 17 2022" .
cmake --build . --verbose --config Release
dsnopek commented 1 month ago

Now that you've figured out what's going on with this, do we still need this issue? Or, is this something you think we should document somewhere?

EDIT: Oh, nevermind, it looks like you have you have PR https://github.com/godotengine/godot-cpp/pull/1600 to fix this. I'll update the description on that one so these are linked.

enetheru commented 1 month ago

If there are build instructions please point me in their direction and I'll update them.

On Thu, Sep 26, 2024, 10:34 PM David Snopek @.***> wrote:

Closed #1582 https://github.com/godotengine/godot-cpp/issues/1582 as completed via #1600 https://github.com/godotengine/godot-cpp/pull/1600.

— Reply to this email directly, view it on GitHub https://github.com/godotengine/godot-cpp/issues/1582#event-14416154182, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANEDDUPTCRSP55CVISPQCTZYQA5HAVCNFSM6AAAAABOEIU3ZKVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJUGQYTMMJVGQYTQMQ . You are receiving this because you authored the thread.Message ID: @.***>

dsnopek commented 1 month ago

I guess there's your build instructions in PR #1595?

enetheru commented 1 month ago

Those were simply what existed as comments just moved to an appropriate location. Will likely require a rewrite sometime soon.

On Fri, Sep 27, 2024, 1:26 PM David Snopek @.***> wrote:

I guess there's your build instructions in PR #1595 https://github.com/godotengine/godot-cpp/pull/1595?

— Reply to this email directly, view it on GitHub https://github.com/godotengine/godot-cpp/issues/1582#issuecomment-2379155909, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANEDDUFPRUKOKSSF4XIRADZYVFITAVCNFSM6AAAAABOEIU3ZKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZZGE2TKOJQHE . You are receiving this because you authored the thread.Message ID: @.***>