Skip to content

WinGUI option is for GUI executables only #8

Description

@aafemt

OptionWinGUI must be used only if the target is a GUI application. If used for console targets, result of linking is broken.

Proposed patch:

diff --git a/src/cbproject.cpp b/src/cbproject.cpp
index 855a8da..fc990ff 100644
--- a/src/cbproject.cpp
+++ b/src/cbproject.cpp
@@ -1151,7 +1151,7 @@ bool CCodeBlocksProject::GenerateMakefile
        //
        // platform check is disabled to allow cross-platform builds
        //if ((pl->OS()==CPlatform::OS_Windows) && (target->Type()==CBuildTarget::ttExecutable))
-       if (!linker->OptionWinGUI().IsEmpty())
+       if ((target->Type()==CBuildTarget::ttExecutable) && !linker->OptionWinGUI().IsEmpty())
        {
         CVariable& v = cmd_args.VarNamed(TPL_LNK_OPTIONS);
         v.SetString(v.GetString()+" "+linker->OptionWinGUI());

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions