Page MenuHomePhabricator

[CMAKE] Avoid displaying the console when launching bitcoin-qt.exe
Needs ReviewPublic

Authored by Fabien on Tue, Mar 12, 12:40.

Details

Reviewers
deadalnix
jasonbcox
Group Reviewers
Restricted Project
Summary

This adds a flag which prevents displaying the console when running
bitcoin-qt.exe.

Depends on D2667

Test Plan

Prerequisite:
Follow the doc/build-windows.md and depends/README.md documentation
and install the dependencies for i686-w64-mingw32 and
x86_64-w64-mingw32.

# 32-bit version
mkdir buildcmake && cd buildcmake
cmake -GNinja .. -DBUILD_BITCOIN_SEEDER=OFF \
  -DCMAKE_TOOLCHAIN_FILE=../cmake/platforms/Win32.cmake
ninja

Check the build succeeds.
Check the generated src/qt/bitcoin-qt.exe binary runs as expected.
Ensure there is no console display when running the exe.

Operate the same for Win64.

# 64-bit version
rm -rf *
cmake -GNinja .. -DBUILD_BITCOIN_SEEDER=OFF \
  -DCMAKE_TOOLCHAIN_FILE=../cmake/platforms/Win64.cmake
ninja

Check the build succeeds.
Check the generated src/qt/bitcoin-qt.exe binary runs as expected.
Ensure there is no console display when running the exe.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
cmake_windows_no_console
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 5209
Build 8481: Bitcoin ABC Teamcity Staging
Build 8480: arc lint + arc unit

Event Timeline

Fabien created this revision.Tue, Mar 12, 12:40
Herald added a reviewer: Restricted Project. · View Herald TranscriptTue, Mar 12, 12:40
Herald added a subscriber: schancel. · View Herald Transcript
jasonbcox accepted this revision.Tue, Mar 12, 15:25
This revision is now accepted and ready to land.Tue, Mar 12, 15:25
deadalnix requested changes to this revision.Thu, Mar 14, 02:45
deadalnix added inline comments.
src/qt/CMakeLists.txt
164

How this isn't windows only ? What is configure doing ?

This revision now requires changes to proceed.Thu, Mar 14, 02:45
Fabien requested review of this revision.Thu, Mar 14, 07:08
Fabien added inline comments.
src/qt/CMakeLists.txt
164

Yes, this is windows only.

Configure does the same in bitcoin_qt.m4:

case $host in
# [...]
*mingw*)
     BITCOIN_QT_CHECK([
       AX_CHECK_LINK_FLAG([[-mwindows]],[QT_LDFLAGS="$QT_LDFLAGS -mwindows"],[AC_MSG_WARN(-mwindows linker support not detected)])
     ])
esac