Skip to content

Performing a CMAKE build with CMAKE_BUILD_TYPE=Release generates godot-cpp template_debug artifacts #1697

Closed
@Naros

Description

@Naros

Godot version

4.4.beta1

godot-cpp version

4.4.beta1 sync hash dfc5196

System information

Windows 11

Issue description

When building the latest godot-cpp based on commit hash dfc51960f9563c6df39a1a0ab66350374f932897, CMAKE uses template_debug although the parent project's CMAKE_BUILD_TYPE is set as Release, i.e.:

Building CXX object extern\godot-cpp\CMakeFiles\godot-cpp.template_debug.dir\gen\src\classes\audio_effect_phaser.cpp.obj
...
Building CXX object extern\godot-cpp\CMakeFiles\godot-cpp.template_debug.dir\gen\src\classes\audio_server.cpp.obj

I also confirmed the build type in my parent CMAKE as follows:

IF ($<CONFIG:Debug>)
    MESSAGE(STATUS "Debug build")
ELSE()
    MESSAGE(STATUS "Release build")
ENDIF()

which outputs

-- Release build

In addition, here are some environment settings my build sets and outputs:

Project Configuration Settings: orchestrator
=============================================

Build Configuration
    CMAKE_SYSTEM_PROCESSOR:..................: AMD64
    CMAKE_HOST_SYSTEM_NAME:..................: Windows
    CMAKE_BUILD_TYPE:........................: Release
    CMAKE_CXX_COMPILER_ARCHITECTURE_ID:......: x64
    CMAKE_CXX_STANDARD:......................: 20
    CMAKE_CXX_COMPILER_VERSION:..............: 19.41.34120.0
    CMAKE_CXX_SIZEOF_DATA_PTR:...............: 8
    CMAKE_GENERATOR:.........................: Ninja
    CMAKE_VERSION:...........................: 3.30.5
    CMAKE_MINIMUM_REQUIRED_VERSION:..........: 3.20
    VCPKG_TARGET_TRIPLET.....................: 
    CMAKE_DEBUG_POSTFIX......................: 
    system_bits..............................: 64
    GDEXTENSION_LIB_NAME.....................: orchestrator.windows.64.release
    RESOLVED_VERSION.........................: 2.2.0
    GIT_COMMIT_HASH..........................: 5a7a5e44c0046e2225af98462731ef2ae24d5db3
    GODOT_CPP_GIT_COMMIT_HASH................: dfc51960f9563c6df39a1a0ab66350374f932897

CMake Paths
    CMAKE_CURRENT_SOURCE_DIR.................: E:/GitHub/godot-orchestrator
    CMAKE_TOOLCHAIN_FILE:....................: 
    CMAKE_SOURCE_DIR:........................: E:/GitHub/godot-orchestrator
    CMAKE_COMMAND:...........................: E:/Jetbrains/CLion/bin/cmake/win/x64/bin/cmake.exe
    CLANG_FORMAT_PROGRAM:....................: 
    SCONS_PROGRAM:...........................: E:/Python/Python312/Scripts/scons.exe
    CMAKE_CXX_COMPILER:......................: E:/VisualStudio/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/cl.exe
    CMAKE_CXX_FLAGS..........................: /DWIN32 /D_WINDOWS /EHsc
    CMAKE_LINKER:............................: E:/VisualStudio/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/link.exe
    CMAKE_EXE_LINKER_FLAGS...................: /machine:x64
    CMAKE_BUILD_TOOL:........................: E:/Jetbrains/CLion/bin/ninja/win/x64/ninja.exe
    vcpkg_executable:........................: 
    godot_debug_editor_executable:...........: E:/GitHub/godot-orchestrator/extern/godot-engine/bin/godot.windows.editor.dev.x86_64.exe
    CMAKE_INSTALL_PREFIX:....................: C:/Program Files (x86)/orchestrator
    CMAKE_BINARY_DIR:........................: E:/GitHub/godot-orchestrator/cmake-build-release
    GDEXTENSION_LIB_PATH:....................: E:/GitHub/godot-orchestrator/project/addons/orchestrator

This creates a conflict between the godot-cpp and parent project based on flags such as /MD and /MT, too. Is there a specific reason why template_debug is used or a way to influence this?

UPDATE: I've also tried building against the latest master commit 3c55ca7a14cffbda60d1d587c965c5a09d02505d and I observe exactly the same behavior.

Steps to reproduce

Just building my plug-in Orchestrator that worked fine prior to the CMake modernization changes.

Minimal reproduction project

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions