Skip to content

Commit

Permalink
CI(Windows): add icon to binary
Browse files Browse the repository at this point in the history
  • Loading branch information
BLumia committed Nov 3, 2022
1 parent 6d1a129 commit 19494ea
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/windows-msys2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
msystem: MINGW64
update: true
pacboy: >-
toolchain:p ninja:p cmake:p
toolchain:p ninja:p cmake:p extra-cmake-modules:p
qt5-static:p bison: flex:
- name: Build
run: |
Expand All @@ -29,7 +29,7 @@ jobs:
run: |
mkdir package_workspace && cd package_workspace
cp ../build/thplayer.exe ./
strip -S ./thplayer.exe
strip -s ./thplayer.exe
# windeployqt -winextras --no-quick-import --no-translations --no-opengl-sw --no-angle --no-system-d3d-compiler ./thplayer.exe
ldd ./thplayer.exe > deps.txt
bash -c 'while read -r line; do path=$(cut -d" " -f3 <<<$line); cp -v $path ./; done <<<$(grep ".*mingw.*bin" deps.txt); exit 0'
Expand Down
18 changes: 16 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.14.0)
cmake_minimum_required(VERSION 3.16.0)
project(thplayer CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand All @@ -11,13 +11,19 @@ add_subdirectory(thtk EXCLUDE_FROM_ALL)
target_include_directories(thtk PUBLIC thtk/)

find_package(Qt5 REQUIRED COMPONENTS Widgets Multimedia)
find_package(ECM 5.83.0 NO_MODULE)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

INCLUDE (CheckTypeSize)
include(CheckTypeSize)

if(ECM_FOUND)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(ECMAddAppIcon)
endif()

SET(CMAKE_EXTRA_INCLUDE_FILES "filesystem")
check_type_size("std::filesystem::path::value_type" PATH_VALSIZE LANGUAGE CXX)
Expand All @@ -39,6 +45,14 @@ add_executable(thplayer
res.qrc
)

if(ECM_FOUND)
ecm_add_app_icon(thplayer
ICONS
assets/256-thplayer.png
assets/thplayer.svg
)
endif()

add_dependencies(thplayer thtk)

get_property(thtk_bindir DIRECTORY thtk/ PROPERTY BINARY_DIR)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# TouHou Player

[![Build status](https://ci.appveyor.com/api/projects/status/3hnd8quh22grg4gv/branch/master?svg=true)](https://ci.appveyor.com/project/BLumia/thplayer/branch/master)
[![Linux Build](https://github.com/BearKidsTeam/thplayer/actions/workflows/linux.yml/badge.svg)](https://github.com/BearKidsTeam/thplayer/actions/workflows/linux.yml) [![Windows MSYS2 Build](https://github.com/BearKidsTeam/thplayer/actions/workflows/windows-msys2.yml/badge.svg)](https://github.com/BearKidsTeam/thplayer/actions/workflows/windows-msys2.yml) [![macOS Build](https://github.com/BearKidsTeam/thplayer/actions/workflows/macos.yml/badge.svg)](https://github.com/BearKidsTeam/thplayer/actions/workflows/macos.yml)

[Website](https://bearkidsteam.github.io/thplayer/)

Expand Down
File renamed without changes

0 comments on commit 19494ea

Please sign in to comment.